Beispiel #1
0
 /**
  * @return LocationQuery
  */
 public function getLocations()
 {
     return $this->hasMany(Location::className(), ['client_id' => 'client_id'])->inverseOf('contacts');
 }
Beispiel #2
0
 public function getLocations()
 {
     return $this->hasMany(Location::className(), ['entity_id' => 'id'])->andOnCondition([Location::tableName() . '.entity' => self::THIS_ENTITY]);
 }
Beispiel #3
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['invoice_id', 'tech_id', 'start_time', 'duration', 'ticketIds'], 'required', 'on' => self::SCENARIO_DEFAULT], [['invoice_id', 'start_time', 'duration'], 'required', 'on' => self::SCENARIO_REMOTE], [['invoice_id', 'tech_id'], 'integer'], [['onSite'], 'boolean'], [['start_time'], 'date', 'format' => 'yyyy-MM-dd HH:mm:ss'], [['duration'], 'integer', 'min' => '15'], [['description'], 'string'], [['ticketIds'], 'each', 'rule' => ['integer']], [['invoice_id'], 'exist', 'targetClass' => Location::className(), 'targetAttribute' => 'id'], [['tech_id'], 'exist', 'targetClass' => Tech::className(), 'targetAttribute' => 'contact_id'], [['ticketIds'], 'each', 'rule' => ['exist', 'targetClass' => Ticket::className(), 'targetAttribute' => 'id']]];
 }
Beispiel #4
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['invoice_id', 'title'], 'required', 'on' => self::SCENARIO_DEFAULT], [['invoice_id', 'priority_id', 'bill_type_id', 'task_id'], 'integer'], [['title'], 'string', 'max' => 100], [['description'], 'string'], [['priority_id'], 'in', 'range' => array_keys(self::$PRIORITIES)], [['bill_type_id'], 'in', 'range' => array_keys(self::$BILL_TYPES)], [['invoice_id'], 'exist', 'targetClass' => Location::className(), 'targetAttribute' => 'id'], [['dup_id'], 'required', 'on' => self::SCENARIO_DUPLICATE], [['dup_id'], 'exist', 'targetClass' => self::className(), 'targetAttribute' => 'id', 'on' => self::SCENARIO_DUPLICATE]];
 }
Beispiel #5
0
 /**
  * @return LocationQuery
  */
 public function getLocation()
 {
     return $this->hasOne(Location::className(), ['id' => 'location_id'])->inverseOf('invoices');
 }