/**
  * atgrie pirmo aktivas personas prasito settingu
  * @param int $type settinga tips
  * @return boolean
  */
 public static function getActivePersonSetingValue($type)
 {
     $personId = Yii::app()->getModule('user')->user()->profile->person_id;
     $criteria = ['ppxs_pprs_id' => $personId, 'ppxs_psty_id' => $type];
     $model = PpxsPersonXSetting::model()->findByAttributes($criteria);
     if (!$model) {
         return false;
     }
     return $model->ppxs_value;
 }
 public function loadModel($id)
 {
     $m = PpxsPersonXSetting::model();
     // apply scope, if available
     $scopes = $m->scopes();
     if (isset($scopes[$this->scope])) {
         $m->{$this->scope}();
     }
     $model = $m->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('D2personModule.crud_static', 'The requested page does not exist.'));
     }
     return $model;
 }