skeeks\cms\models\CmsComponentSettings::fetchByComponentUserId PHP Method

fetchByComponentUserId() public static method

Получение настроек для компонента, и пользователя.
public static fetchByComponentUserId ( Component $component, integer $user_id ) : static
$component skeeks\cms\base\Component компонент с настройками
$user_id integer id пользователя
return static
    public static function fetchByComponentUserId($component, $user_id)
    {
        return static::baseQuery($component)->andWhere(['user_id' => (int) $user_id])->one();
    }

Usage Example

Example #1
0
 /**
  * @inheritdoc
  */
 public function getDataCellValue($model, $key, $index)
 {
     $settings = null;
     if ($this->component === null) {
         return $this->_result(Cms::BOOL_N);
     }
     if ($model instanceof CmsSite) {
         $settings = \skeeks\cms\models\CmsComponentSettings::fetchByComponentSiteCode($this->component, $model->code);
     }
     if ($model instanceof User) {
         $settings = \skeeks\cms\models\CmsComponentSettings::fetchByComponentUserId($this->component, $model->id);
     }
     if ($settings) {
         return $this->_result(Cms::BOOL_Y);
     }
     return $this->_result(Cms::BOOL_N);
 }
All Usage Examples Of skeeks\cms\models\CmsComponentSettings::fetchByComponentUserId