Exemple #1
0
 public function fields()
 {
     if ($this->scenario == self::SCENARIO_PATH) {
         return array_merge(parent::fields(), ["category"]);
     }
     return parent::fields();
 }
Exemple #2
0
 public function fields()
 {
     $fields = parent::fields();
     // remove fields that contain sensitive information
     unset($fields['auth_key'], $fields['password_hash'], $fields['password_reset_token']);
     return $fields;
 }
Exemple #3
0
 public function fields()
 {
     $fields = parent::fields();
     $fields["comment_id"] = $fields['id'];
     //  remove fields that contain sensitive information
     unset($fields['id']);
     return $fields;
 }
Exemple #4
0
 public function beforeSave($insert)
 {
     if ($insert) {
         $this->status = self::STATUS_ACTIVE;
         // 默认上传的头像通过验证
     }
     return parent::beforeSave($insert);
 }
Exemple #5
0
 public function fields()
 {
     //$fields = array_merge(parent::fields(), ['shortName', 'fullName']);
     $fields = parent::fields();
     unset($fields['picture']);
     if ($this->scenario == self::SCENARIO_LIMITED) {
         unset($fields['user_id']);
         unset($fields['birthday']);
     }
     return $fields;
 }
Exemple #6
0
 public function fields()
 {
     if ($this->scenario == self::SCENARIO_LIMITED) {
         $fields = parent::fields();
         unset($fields['place_id']);
         unset($fields['geo_id']);
         unset($fields['address']);
         unset($fields['post_index']);
         return $fields;
     }
     return parent::fields();
 }
 public function fields()
 {
     $parent = parent::fields();
     unset($parent['id']);
     unset($parent['employee_id']);
     unset($parent['service_id']);
     $fields = [];
     if ($this->scenario == self::SCENARIO_EMPLOYEE) {
         $fields[] = 'service';
     } else {
         $fields[] = 'employee';
     }
     return array_merge($parent, $fields);
 }
Exemple #8
0
 public function fields()
 {
     $parent = parent::fields();
     $extra = [];
     if ($this->scenario == self::SCENARIO_SERVICE_LIMITED) {
         $extra[] = 'place';
         unset($parent['id']);
         unset($parent['service_id']);
         unset($parent['place_id']);
     }
     if ($this->scenario == self::SCENARIO_PLACE_LIMITED) {
         $extra[] = 'name';
         unset($parent['id']);
         unset($parent['place_id']);
     }
     return array_merge($parent, $extra);
 }
Exemple #9
0
 public function fields()
 {
     $fields = parent::fields();
     // remove fields that contain sensitive information
     return $fields;
 }
Exemple #10
0
 public function extraFields()
 {
     return array_merge(parent::extraFields(), ['services']);
 }
Exemple #11
0
 public function extraFields()
 {
     return array_merge(parent::extraFields(), ['places', 'path']);
     //'employees',
 }
Exemple #12
0
 public function extraFields()
 {
     $extraFields = array_merge(parent::extraFields(), ['rate', 'services', 'reviews', 'employees', 'geo', 'images', 'currency']);
     return $extraFields;
 }
Exemple #13
0
 public function fields()
 {
     $fields = array_merge(parent::fields(), ['file']);
     return $fields;
 }
Exemple #14
0
 public function afterFind()
 {
     $this->setAttribute('value', unserialize($this->getAttribute('value')));
     // value 数据反序列化
     parent::afterFind();
 }
Exemple #15
0
 public function extraFields()
 {
     $extraFields = array_merge(parent::extraFields(), ['place', 'user']);
     return $extraFields;
 }