public function fields() { if ($this->scenario == self::SCENARIO_PATH) { return array_merge(parent::fields(), ["category"]); } return parent::fields(); }
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; }
public function fields() { $fields = parent::fields(); $fields["comment_id"] = $fields['id']; // remove fields that contain sensitive information unset($fields['id']); return $fields; }
public function beforeSave($insert) { if ($insert) { $this->status = self::STATUS_ACTIVE; // 默认上传的头像通过验证 } return parent::beforeSave($insert); }
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; }
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); }
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); }
public function fields() { $fields = parent::fields(); // remove fields that contain sensitive information return $fields; }
public function extraFields() { return array_merge(parent::extraFields(), ['services']); }
public function extraFields() { return array_merge(parent::extraFields(), ['places', 'path']); //'employees', }
public function extraFields() { $extraFields = array_merge(parent::extraFields(), ['rate', 'services', 'reviews', 'employees', 'geo', 'images', 'currency']); return $extraFields; }
public function fields() { $fields = array_merge(parent::fields(), ['file']); return $fields; }
public function afterFind() { $this->setAttribute('value', unserialize($this->getAttribute('value'))); // value 数据反序列化 parent::afterFind(); }
public function extraFields() { $extraFields = array_merge(parent::extraFields(), ['place', 'user']); return $extraFields; }