/** * @inheritdoc */ public function fields() { $fields = parent::fields(); $fields['class_trainer_name'] = function () { $trainer = $this->getTrainer()->toArray(); return $trainer['user_type'] === "studio" ? $trainer['payment']['payment_bussines_name'] : $trainer['payment']['payment_first_name'] . " " . $trainer['payment']['payment_last_name']; }; $fields['stream'] = function () { return $this->getStream(); }; $fields['pay_sum'] = function () { return (int) $this->getSumPay(); }; $fields['pay_count'] = function () { return (int) $this->getStudentCount(); }; $fields['activity_name'] = function () { return $this->getActivity(); }; $fields['studio_trainer'] = function () { return $this->getStudioTrainer(); }; if (Yii::$app->request->get('booking')) { $fields['students'] = function () { return $this->getStudentList(); }; } return $fields; }
public function fields() { $fields = parent::fields(); $fields['title'] = 'titleLang'; $fields['description'] = 'description'; return $fields; }
/** * 过滤最终返回的字段 * * @author NJ 2016年8月1日15:21:44 * @return array 字段 * */ public function fields() { # code... $fields = parent::fields(); unset($fields['code']); return $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[] = 'artist'; $fields[] = 'singleStyles'; return $fields; }
public function fields() { $fields = parent::fields(); error_log(print_r($fields, 1)); unset($fields['password']); return $fields; }
public function fields() { $fields = parent::fields(); $fields['bookings_count'] = function () { return (int) $this->getBookingsCount(); }; return $fields; }
public function fields() { $fields = parent::fields(); $fields['cover'] = function ($model) { return file_exists($model->getCoverPath()) ? $model->getCoverPath() : ''; }; return $fields; }
/** * @inheritdoc */ public function fields() { $fields = parent::fields(); unset($fields['auth_key']); unset($fields['password_hash']); unset($fields['password_reset_token']); return $fields; }
public function fields() { $fields = parent::fields(); /* $fields['code'] = function ($model) { return (new District())->getCodeById($model->district_id); }; */ //unset($fields['created_by'],$fields['updated_by'],$fields['created_at'],$fields['updated_at']); return $fields; }
/** * @inheritdoc */ public function fields() { $fields = parent::fields(); unset($fields['tree'], $fields['lft'], $fields['rgt'], $fields['depth']); $fields['hasChildren'] = function ($model) { /** @var Tree $model */ return $model->children(1)->count() > 0; }; return $fields; }
public function fields() { $fields = parent::fields(); unset($fields['mem']); return array_merge($fields, ['data', 'date' => function () { return Time::dateNormalize($this->created); }, 'model' => function () { return $this->getData()->getModel(); }]); // TODO: Change the autogenerated stub }
/** * @inheritdoc */ public function fields() { $fields = parent::fields(); $fields['sender'] = function () { return $this->getSender(); }; $fields['receiver'] = function () { return $this->getReceiver(); }; return $fields; }
public function fields() { $fields = parent::fields(); $fields['password'] = function () { return '******'; }; $fields['roles'] = function () { return \yii\helpers\ArrayHelper::getColumn(Yii::$app->authManager->getRolesByUser($this->id), 'name'); }; unset($fields['auth_key'], $fields['access_token']); return $fields; }
/** * @inheritdoc */ public function fields() { $result = parent::fields(); unset($result['auth_key']); unset($result['fb_uid']); unset($result['role']); unset($result['status']); if (isset($result['gender'])) { $result['gender'] = 'genderName'; } return $result; }
public function fields() { $fields = parent::fields(); $fields['student_name'] = function () { $student = $this->getStudentName(); return $student->payment_first_name . ' ' . $student->payment_last_name; }; $fields['dispute_type'] = function () { return $this->getDisputeType(); }; return $fields; }
public function getFields() { $fields = []; $modelFields = count($this->activeRecord->fields()) > 0 ? $this->activeRecord->fields() : $this->activeRecord->attributes(); foreach ($modelFields as $key => $value) { if (is_int($key)) { $fields[] = $value; } else { $fields[] = $key; } } return $fields; }
/** * Makes the relationships available with the expand property in the Ingredients routes. * */ public function extraFields() { $fields = parent::fields(); $fields['relationships']['pizza'] = function ($ingredient) { $to_return['data'] = []; $i = 0; foreach ($ingredient->pizzaIngredients as $pizzaIngredient) { $to_return['data'][$i] = $pizzaIngredient->pizza->toArray(); $to_return['data'][$i]['quantity'] = $pizzaIngredient->quantity; $to_return['data'][$i][Link::REL_SELF] = $pizzaIngredient->pizza->getLinks(); $i++; } }; return $fields; }
public function fields() { $fields = parent::fields(); unset($fields['user_name']); $fields['user_password'] = '******'; return $fields; /* return [ 'id', 'user_name'=>'liangxifeng', 'user_password'=>'123456', 'user_personid'=>function(){ return '123'; } ]; */ }
/** * @inheritdoc */ public function fields() { $fields = parent::fields(); $fields['class_trainer_name'] = function () { $trainer = $this->getTrainer()->toArray(); return $trainer['user_type'] === "studio" ? $trainer['payment']['payment_bussines_name'] : $trainer['payment']['payment_first_name'] . " " . $trainer['payment']['payment_last_name']; }; $fields['pay_count'] = function () { return (int) $this->getStudentCount(); }; $fields['activity_name'] = function () { return $this->getActivity(); }; $fields['dispute_count'] = function () { return $this->getDisputeCount(); }; return $fields; }
/** * @inheritdoc */ public function fields() { $fields = parent::fields(); unset($fields['password_hash'], $fields['token'], $fields['auth_key']); $fields['created_at_format'] = function (Account $Model) { return Formatter()->asDatetime($Model->created_at); }; $fields['updated_at_format'] = function (Account $Model) { return Formatter()->asDatetime($Model->updated_at); }; $fields['deleted_at_format'] = function (Account $Model) { return Formatter()->asDatetime($Model->deleted_at); }; $fields['activated_at_format'] = function (Account $Model) { return Formatter()->asDatetime($Model->activated_at); }; $fields['avatar'] = [$this, 'getAvatar']; $fields['deleted'] = [$this, 'isDeleted']; $fields['activated'] = [$this, 'isActivated']; return $fields; }
/** * @inheritdoc */ public function fields() { $fields = parent::fields(); $user = User::findIdentityByAccessToken(\Yii::$app->request->get('access-token')); if (is_object($user) && $this->user_id == $user->user_id) { $fields['auth'] = function () { $user = $this->getUser(); return ['stream_userid' => $user->stream_userid, 'stream_username' => $user->stream_username, 'stream_password' => $user->stream_password]; }; } else { $fields = []; } $fields['public_url'] = function () { $name = explode("=", $this->stream_stream); if (is_array($name) && count($name) === 3) { $file = $name[2]; return "http://rrr.sz.xlcdn.com/?account=gtecmedia&file={$file}&type=live&service=wowza&output=player"; } return null; }; return $fields; }
public function fields() { $fields = parent::fields(); $fields['bookings_count'] = function () { return $this->getBookingsCount(); }; $fields[] = 'payment'; // $fields['payment'] = function () { // return $this->getPayment(); // }; $fields['active_lead'] = function () { return $this->getDataForFields('payment_active_lead'); }; $fields['clientele'] = function () { return $this->getDataForFields('payment_clientele'); }; $fields['certifications'] = function () { return $this->getDataForFields('payment_certifications'); }; $fields['profession'] = function () { return $this->getDataForFields('payment_profession'); }; return $fields; }
public function fields() { $fields = parent::fields(); unset($fields['content']); return $fields; }
/** @inheritdoc */ public function fields() { $fields = parent::fields(); unset($fields['entity_id'], $fields['id']); return $fields; }
public function fields() { $fields = parent::fields(); $fields['state'] = function () { return $this->getState(); }; $fields['country'] = function () { return $this->getCountry(); }; return $fields; }
/** * @inheritdoc */ public function fields() { $fields = parent::fields(); $fields['objectdetail'] = function ($model) { return NavItemPage::getBlock($model->id); }; return $fields; }
public function fields() { $parent = parent::fields(); unset($parent['image_id']); return array_merge($parent, ['image']); }
/** * Return a list of all model attribute names recursing structured dynamic attributes. * * @return array an array of all attribute names in dotted notation * @throws Exception */ public function dotAttributeNames() { return array_merge(array_values(parent::fields()), array_keys(static::dotKeyValues(static::dynamicColumn(), $this->_dynamicAttributes))); }
public function fields() { $fields = parent::fields(); $fields['pictures'] = 'productPictures'; return $fields; }