/** * @return \yii\db\ActiveQuery */ public function getContacts() { return $this->hasMany(Contact::className(), ['contact_category_id' => 'id']); }
/** * @return ContactQuery */ public function getCreatedBy() { return $this->hasOne(Contact::className(), ['id' => 'created_by']); }
/** * @inheritdoc */ public function rules() { return [[['contact_id', 'startTime', 'endTime', 'roles'], 'required'], [['contact_id'], 'integer'], [['password'], 'string', 'min' => 6, 'max' => 32], [['confirm_password'], 'compare', 'compareAttribute' => 'password'], [['start_of_day', 'end_of_day'], 'date', 'format' => 'HH:mm'], [['end_of_day'], 'compare', 'operator' => '>', 'compareAttribute' => 'start_of_day'], [['roles'], 'each', 'rule' => ['string']], [['contact_id'], 'exist', 'targetClass' => Contact::className(), 'targetAttribute' => 'id'], [['contact_id'], 'unique', 'targetClass' => Tech::className(), 'message' => 'This user already has an account.'], [['roles'], 'each', 'rule' => ['in', 'range' => ArrayHelper::getColumn(Yii::$app->authManager->getRoles(), 'name')]]]; }
/** * @return ContactQuery */ public function getContacts() { return $this->hasMany(Contact::className(), ['client_id' => 'id'])->inverseOf('client'); }
/** * @return ContactQuery */ public function getContact() { return $this->hasOne(Contact::className(), ['id' => 'contact_id'])->inverseOf('user'); }
/** * @return ContactQuery */ public function getAuthor() { return $this->hasOne(Contact::className(), ['id' => 'author_id'])->inverseOf('notes'); }
/** * @return ContactQuery */ public function getApprovedBy() { return $this->hasOne(Contact::className(), ['id' => 'contact_id'])->viaTable('tbl_ticket_approval', ['ticket_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getContacts() { return $this->hasMany(Contact::className(), ['tenant_id' => 'id']); }
/** * Executes the rule. * * @param string|integer $user the user ID. This should be either an integer or a string representing * the unique identifier of a user. See [[\yii\web\User::id]]. * @param Item $item the role or permission that this rule is associated with * @param array $params parameters passed to [[ManagerInterface::checkAccess()]]. * @return boolean a value indicating whether the rule permits the auth item it is associated with. */ public function execute($user, $item, $params) { return isset($params['contact']) ? $params['contact']->className() == Contact::className() && $params['contact']->client_id !== Client::MASTER_ID : false; }
/** * @return \yii\db\ActiveQuery */ public function getContactId() { return $this->hasOne(Contact::className(), ['id' => 'contact_id']); }
/** * @return \yii\db\ActiveQuery */ public function getContacts() { return $this->hasMany(Contact::className(), ['roles_code' => 'code']); }