/**
  * @return \yii\db\ActiveQuery
  */
 public function getContacts()
 {
     return $this->hasMany(Contact::className(), ['contact_category_id' => 'id']);
 }
Exemple #2
0
 /**
  * @return ContactQuery
  */
 public function getCreatedBy()
 {
     return $this->hasOne(Contact::className(), ['id' => 'created_by']);
 }
Exemple #3
0
 /**
  * @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')]]];
 }
Exemple #4
0
 /**
  * @return ContactQuery
  */
 public function getContacts()
 {
     return $this->hasMany(Contact::className(), ['client_id' => 'id'])->inverseOf('client');
 }
Exemple #5
0
 /**
  * @return ContactQuery
  */
 public function getContact()
 {
     return $this->hasOne(Contact::className(), ['id' => 'contact_id'])->inverseOf('user');
 }
Exemple #6
0
 /**
  * @return ContactQuery
  */
 public function getAuthor()
 {
     return $this->hasOne(Contact::className(), ['id' => 'author_id'])->inverseOf('notes');
 }
Exemple #7
0
 /**
  * @return ContactQuery
  */
 public function getApprovedBy()
 {
     return $this->hasOne(Contact::className(), ['id' => 'contact_id'])->viaTable('tbl_ticket_approval', ['ticket_id' => 'id']);
 }
Exemple #8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getContacts()
 {
     return $this->hasMany(Contact::className(), ['tenant_id' => 'id']);
 }
Exemple #9
0
 /**
  * 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']);
 }
Exemple #11
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getContacts()
 {
     return $this->hasMany(Contact::className(), ['roles_code' => 'code']);
 }