Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Model;
- use AlexServicesModelsService;
- /**
- * Model
- */
- class Order extends Model
- {
- use OctoberRainDatabaseTraitsValidation;
- /*
- * Disable timestamps by default.
- * Remove this line if timestamps are defined in the database table.
- */
- public $timestamps = false;
- /**
- * @var string The database table used by the model.
- */
- public $table = 'alex_services_orders';
- /**
- * @var array Validation rules
- */
- public $rules = [
- ];
- /*Relations*/
- public $belongsToMany = [
- 'services' =>[
- 'AlexServicesModelsService',
- 'table' => 'alex_services_services_orders',
- 'order' => 'name'
- ]
- ];
- // я вывел список услуг в выпадающий список
- public function getServicesOptions(){
- return Service::lists('name', 'id');
- }
- }
Add Comment
Please, Sign In to add comment