Пример #1
0
 /**
  * @inheritdoc
  * @codeCoverageIgnore
  */
 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios[self::SCENARIO_WAREHOUSE] = ['CityRef', 'FindByString'];
     $scenarios[self::SCENARIO_GET_CITIES] = ['Ref', 'FindByString'];
     $scenarios[self::SCENARIO_SAVE] = ['BuildingNumber', 'CounterpartyRef', 'Flat', 'Note', 'StreetRef'];
     $scenarios[self::SCENARIO_UPDATE] = ['BuildingNumber', 'CounterpartyRef', 'Flat', 'Note', 'StreetRef', 'Ref'];
     return $scenarios;
 }
Пример #2
0
 /**
  * @inheritdoc
  * @codeCoverageIgnore
  */
 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios[self::SCENARIO_GET_COUNTERPARTIES] = ['CounterpartyProperty', 'FindByString'];
     $scenarios[self::SCENARIO_GET_ADDRESSES] = ['Ref', 'CounterpartyProperty'];
     $scenarios[self::SCENARIO_GET_CONTACT_PERSONS] = ['Ref'];
     $scenarios[self::SCENARIO_SAVE] = ['CityRef', 'CounterpatyType', 'CounterpartyProperty', 'Email', 'FirstName', 'LastName', 'MiddleName', 'Phone'];
     $scenarios[self::SCENARIO_UPDATE] = ['CityRef', 'CounterpatyType', 'CounterpartyProperty', 'Email', 'FirstName', 'LastName', 'MiddleName', 'Phone', 'Ref'];
     return $scenarios;
 }
Пример #3
0
 /**
  * Skip model attributes
  */
 protected function flushAttributes()
 {
     $values = array_fill(0, count($this->model->attributes()), null);
     $attributes = array_combine($this->model->attributes(), $values);
     $this->model->setAttributes($attributes);
 }