示例#1
0
 /**
  * ContentRatingChange constructor. Pass inside record, type and user object
  * @param Content $record
  * @param string $type
  * @param iUser $user
  */
 public function __construct($record, $type, $user)
 {
     $this->_content = $record;
     $this->_type = $type;
     $this->_user = $user;
     parent::__construct();
 }
示例#2
0
 /**
  * EntityCategoryList constructor. Pass pathway as string and data of multi-category system
  * @param string $path
  * @param array $configs
  * @param int $offset
  * @param string $sort
  */
 public function __construct($path, array $configs, $offset = 0, $sort = 'newest')
 {
     $this->_path = $path;
     $this->_configs = $configs;
     $this->_page = (int) $offset;
     $this->_sort = $sort;
     parent::__construct();
 }
示例#3
0
 /**
  * EntityDeleteRoute constructor. Pass parameters from controller
  * @param string|null $type
  * @param string|null $loader
  * @param string|null $source
  */
 public function __construct($type = null, $loader = null, $source = null)
 {
     $this->type = $type;
     $this->loader = $loader;
     $this->source = $source;
     $this->_cfg = App::$Properties->getAll('Routing');
     parent::__construct(true);
 }
示例#4
0
 /**
  * SearchContainer constructor. Pass string query inside
  * @param string $query
  * @param int $limit
  */
 public function __construct($query, $limit = 10)
 {
     $this->query = $query;
     $this->limit = (int) $limit;
     if ($this->limit < 1) {
         $this->limit = 1;
     }
     parent::__construct();
 }
示例#5
0
 /**
  * FormInstall constructor. Pass applications object from controller
  * @param $apps
  * @param string $type
  * @throws SyntaxException
  */
 public function __construct(array $apps = null, $type)
 {
     $this->_apps = $apps;
     // check if passed type is allowed to use
     if (!Arr::in($type, ['app', 'widget'])) {
         throw new SyntaxException('The type of extension is not defined!');
     }
     $this->_type = $type;
     parent::__construct();
 }
示例#6
0
 /**
  * EntityContentSearch constructor. Pass search terms (query string) to model and used items to skip it by id.
  * @param $terms
  * @param int|array $skipIds
  */
 public function __construct($terms, $skipIds = 0)
 {
     $this->_terms = App::$Security->strip_tags(trim($terms, ' '));
     if (Obj::isLikeInt($skipIds)) {
         $this->_skip = [$skipIds];
     } elseif (Obj::isArray($skipIds)) {
         $this->_skip = $skipIds;
     }
     parent::__construct();
 }
示例#7
0
 /**
  * EntityCommentPostData constructor. Pass inside the model active record object of comment post or answer
  * @param $record
  * @throws JsonException
  */
 public function __construct($record, $calcAnswers = true)
 {
     $this->_record = $record;
     $this->_calcAnswers = (bool) $calcAnswers;
     if ($this->_record instanceof CommentPost) {
         $this->_type = 'post';
     } elseif ($this->_record instanceof CommentAnswer) {
         $this->_type = 'answer';
     } else {
         throw new JsonException('Unknown comment request');
     }
     parent::__construct();
 }
示例#8
0
 /**
  * EntityBuildMap constructor. Pass available languages and data as array inside.
  * @param array|null $langs
  * @param array|null $data
  */
 public function __construct(array $langs = null, array $data = null)
 {
     $this->langs = $langs;
     if ($data !== null && count($data) > 0) {
         foreach ($data as $item) {
             if (!Obj::isArray($item) || !isset($item['uri'], $item['lastmod'])) {
                 continue;
             }
             $this->add($item['uri'], $item['lastmod'], $item['freq'], $item['priority']);
         }
     }
     parent::__construct();
 }
示例#9
0
 /**
  * EntitySearchMain constructor. Pass query inside
  * @param string $query
  * @param array|null $configs
  */
 public function __construct($query, array $configs = null)
 {
     $this->query = $query;
     $this->_configs = $configs;
     parent::__construct();
 }
示例#10
0
 /**
  * FormContentUpdate constructor. Pass content active record inside
  * @param Content $content
  */
 public function __construct(Content $content)
 {
     $this->_content = $content;
     parent::__construct();
 }
示例#11
0
 /**
  * EntityAddNotification constructor. Pass target user_id inside the model
  * @param bool $targetId
  */
 public function __construct($targetId)
 {
     $this->_targetId = $targetId;
     parent::__construct();
 }
示例#12
0
 /**
  * EntityContentRead constructor. Pass active record objects
  * @param ContentCategory $category
  * @param Content $content
  */
 public function __construct(ContentCategory $category, Content $content)
 {
     $this->_category = $category;
     $this->_content = $content;
     parent::__construct();
 }
示例#13
0
 /**
  * FormContentRestore constructor. Pass active record object inside
  * @param Content $record
  */
 public function __construct(Content $record)
 {
     $this->_record = $record;
     parent::__construct();
 }
示例#14
0
 /**
  * FormIgnoreDelete constructor. Pass current user object and target user id inside
  * @param iUser $user
  * @param int $target_id
  */
 public function __construct(iUser $user, $target_id)
 {
     $this->_user = $user;
     $this->_target_id = $target_id;
     parent::__construct(true);
 }
示例#15
0
 /**
  * FormCommentDelete constructor. Pass active record and type of comment system inside.
  * @param object $record
  * @param string $type
  */
 public function __construct($record, $type)
 {
     $this->_record = $record;
     $this->_type = $type;
     parent::__construct();
 }
示例#16
0
 /**
  * FormContentGlobDelete constructor. Pass records inside.
  * @param Content[]|Collection $records
  */
 public function __construct($records)
 {
     $this->_records = $records;
     parent::__construct();
 }
示例#17
0
 /**
  * FormUserDelete constructor. Pass user ids inside
  * @param array $ids
  */
 public function __construct(array $ids)
 {
     $this->_ids = $ids;
     parent::__construct(true);
 }
示例#18
0
 /**
  * FormCategoryUpdate constructor. Pass record object inside model
  * @param ContentCategory $record
  * @param int|null $dependId
  */
 public function __construct(ContentCategory $record, $dependId = null)
 {
     $this->_record = $record;
     $this->_tmpDependId = $dependId;
     parent::__construct();
 }
示例#19
0
 /**
  * FormUpdateDownload constructor. Pass download url & tag name inside
  * @param bool $url
  * @param $name
  */
 public function __construct($url, $name)
 {
     $this->url = $url;
     $this->name = $name;
     parent::__construct();
 }
示例#20
0
 /**
  * EntityIndexList constructor. Pass current language from controller request
  * @param string|null $currentLang
  */
 public function __construct($currentLang = null)
 {
     $this->_lang = $currentLang;
     parent::__construct();
 }
示例#21
0
 /**
  * FormUpdateDatabase constructor. Pass db and script version inside
  * @param string $db
  * @param string $script
  */
 public function __construct($db, $script)
 {
     $this->dbVersion = $db;
     $this->scriptVersion = $script;
     parent::__construct(true);
 }
示例#22
0
 /**
  * FormCommentUpdate constructor. Pass record inside the model.
  * @param \Apps\ActiveRecord\CommentPost|\Apps\ActiveRecord\CommentAnswer $record
  */
 public function __construct($record, $type = 'comment')
 {
     $this->_record = $record;
     parent::__construct();
 }
示例#23
0
 /**
  * FormNarrowContentUpdate constructor. Pass record object inside.
  * @param Content $record
  * @param array $configs
  */
 public function __construct(Content $record, $configs)
 {
     $this->_record = $record;
     $this->_configs = $configs;
     parent::__construct();
 }
示例#24
0
 /**
  * FormFieldUpdate constructor. Pass profile field record inside
  * @param ProfileField $record
  */
 public function __construct(ProfileField $record)
 {
     $this->_record = $record;
     parent::__construct();
 }
示例#25
0
 /**
  * FormRegister constructor. Build model and set maker if captcha is enabled
  * @param bool $captcha
  */
 public function __construct($captcha = false)
 {
     $this->_captcha = $captcha;
     parent::__construct(true);
 }
示例#26
0
 /**
  * FormFeedbackAdd constructor. Pass captcha marker enabled inside
  * @param bool $captcha
  */
 public function __construct($captcha = true)
 {
     $this->_useCaptcha = (bool) $captcha;
     parent::__construct();
 }
示例#27
0
 /**
  * Constructor with user object relation
  * @param iUser $user
  */
 public function __construct(iUser $user)
 {
     $this->_user = $user;
     parent::__construct(true);
 }
示例#28
0
 /**
  * Construct FormLogin. Pass is captcha used inside
  * @param bool $captcha
  */
 public function __construct($captcha = false)
 {
     $this->_captcha = $captcha;
     // tell that we shall use csrf protection
     parent::__construct(true);
 }
示例#29
0
 /**
  * FormSettings constructor. Pass configuration inside as factory.
  * @param array $configs
  */
 public function __construct(array $configs = null)
 {
     $this->_configs = $configs;
     parent::__construct();
 }
示例#30
0
 /**
  * FormAnswerAdd constructor. Pass active record of comment post and user id
  * @param $recordPost
  * @param int $userId
  */
 public function __construct($recordPost, $userId = 0)
 {
     $this->_post = $recordPost;
     $this->_userId = (int) $userId;
     parent::__construct();
 }