本文整理汇总了PHP中Entity::Init方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::Init方法的具体用法?PHP Entity::Init怎么用?PHP Entity::Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::Init方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Init
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('category_title', 'string', 'max' => 200, 'min' => 2, 'allowEmpty' => false, 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_categories_create_title_title'), 'on' => array('receptiondesk_category'));
$this->aValidateRules[] = array('category_description', 'string', 'max' => 200, 'min' => 2, 'allowEmpty' => false, 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_categories_create_description_title'), 'on' => array('receptiondesk_category'));
$this->aValidateRules[] = array('category_title', 'category_title_exists', 'on' => array('receptiondesk_category'));
$this->aValidateRules[] = array('category_url', 'category_url_exists', 'on' => array('receptiondesk_category'));
}
示例2: Init
/**
* Инициализация
*/
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('text', 'string', 'max' => Config::Get('module.user.complaint_text_max'), 'min' => 1, 'allowEmpty' => !Config::Get('module.user.complaint_text_required'), 'label' => $this->Lang_Get('user_complaint_text_title'));
if (Config::Get('module.user.complaint_captcha')) {
$sCaptchaValidateType = func_camelize('captcha_' . Config::Get('sys.captcha.type'));
$this->aValidateRules[] = array('captcha', $sCaptchaValidateType, 'name' => 'complaint_user');
}
}
示例3: Init
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('question_category_id', 'question_category_id', 'on' => array('receptiondesk_question', 'receptiondesk_question_edit'));
$this->aValidateRules[] = array('question_text', 'string', 'max' => Config::Get('plugin.receptiondesk.receptiondesk_question_text_max_length'), 'min' => 2, 'allowEmpty' => false, 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_question_create_text_title'), 'on' => array('receptiondesk_question', 'receptiondesk_question_edit'));
$this->aValidateRules[] = array('question_text_hash', 'question_text_hash', 'on' => array('receptiondesk_question'));
$this->aValidateRules[] = array('question_author_mail', 'email', 'allowEmpty' => Config::Get('plugin.receptiondesk.receptiondesk_create_mail_empty'), 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_question_create_author_mail_title'), 'on' => array('receptiondesk_question'));
$this->aValidateRules[] = array('question_captcha', 'captcha', 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_question_create_author_captcha_title'), 'on' => array('receptiondesk_question'));
$this->aValidateRules[] = array('answer_text', 'string', 'min' => 2, 'allowEmpty' => true, 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_answer_create_text_title'), 'on' => array('receptiondesk_question'));
}
示例4: Init
public function Init()
{
parent::Init();
if (!$this->GetSourceType()) {
$this->SetSourceType();
}
if (!$this->GetSmarty()) {
$this->SetSmarty($this->Viewer_GetSmartyObject());
}
}
示例5: Init
/**
* Определяем правила валидации
*/
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('topic_title', 'string', 'max' => Config::Get('module.topic.title_max_length'), 'min' => Config::Get('module.topic.title_min_length'), 'allowEmpty' => Config::Get('module.topic.title_allow_empty'), 'label' => $this->Lang_Get('topic.add.fields.title.label'));
$this->aValidateRules[] = array('topic_slug_raw', 'regexp', 'allowEmpty' => true, 'pattern' => '#^[a-z0-9\\-]{1,500}$#i');
$this->aValidateRules[] = array('topic_text_source', 'string', 'max' => Config::Get('module.topic.max_length'), 'min' => Config::Get('module.topic.min_length'), 'allowEmpty' => Config::Get('module.topic.allow_empty'), 'condition' => 'isNeedValidateText', 'label' => $this->Lang_Get('topic.add.fields.text.label'));
$this->aValidateRules[] = array('topic_tags', 'tags', 'countMax' => 15, 'condition' => 'isNeedValidateTags', 'label' => $this->Lang_Get('topic.add.fields.tags.label'), 'allowEmpty' => Config::Get('module.topic.allow_empty_tags'));
$this->aValidateRules[] = array('blogs_id_raw', 'blogs');
$this->aValidateRules[] = array('topic_text_source', 'topic_unique');
$this->aValidateRules[] = array('topic_slug_raw', 'slug_check');
}
示例6: Init
/**
* Define of validation rule
*/
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('topic_title', 'string', 'max' => 200, 'min' => 2, 'allowEmpty' => false, 'label' => E::ModuleLang()->Get('topic_create_title'), 'on' => array('topic'));
$this->aValidateRules[] = array('question_title', 'string', 'max' => 200, 'min' => 2, 'allowEmpty' => true, 'label' => E::ModuleLang()->Get('topic_create_question_title'), 'on' => array('topic'));
$this->aValidateRules[] = array('topic_text_source', 'string', 'max' => Config::Get('module.topic.max_length'), 'min' => 2, 'allowEmpty' => false, 'label' => E::ModuleLang()->Get('topic_create_text'), 'on' => array('topic'));
$this->aValidateRules[] = array('topic_tags', 'tags', 'count' => 15, 'allowEmpty' => Config::Get('module.topic.allow_empty_tags'), 'label' => E::ModuleLang()->Get('topic_create_tags'), 'on' => array('topic'));
$this->aValidateRules[] = array('blog_id', 'blog_id', 'on' => array('topic'));
$this->aValidateRules[] = array('topic_text_source', 'topic_unique', 'on' => array('topic'));
$this->aValidateRules[] = array('topic_type', 'topic_type', 'on' => array('topic'));
$this->aValidateRules[] = array('link_url', 'url', 'allowEmpty' => true, 'label' => E::ModuleLang()->Get('topic_link_create_url'), 'on' => array('topic'));
}
示例7: Init
/**
* Определяем правила валидации
* Правила валидации нужно определять только здесь!
*
* @var array
*/
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('login', 'login', 'on' => array('registration', ''));
$this->aValidateRules[] = array('login', 'login_exists', 'on' => array('registration'));
$this->aValidateRules[] = array('mail', 'email', 'allowEmpty' => false, 'on' => array('registration', ''));
$this->aValidateRules[] = array('mail', 'mail_exists', 'on' => array('registration'));
$this->aValidateRules[] = array('password', 'password', 'on' => array('registration'));
$this->aValidateRules[] = array('password_confirm', 'compare', 'compareField' => 'password', 'on' => array('registration'));
// Определяем дополнительные правила валидации
if (Config::Get('module.user.captcha_use_registration')) {
$this->aValidateRules[] = array('captcha', 'captcha', 'on' => array('registration'));
}
}
示例8: Init
public function Init()
{
parent::Init();
$this->aCfg = Config::GetData('module.captcha');
$this->Reset();
}
示例9: Init
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('subscription_mail', 'email', 'allowEmpty' => false, 'label' => $this->Lang_Get('plugin.subscription.subscription_block_subscription_input'), 'on' => array('subscription_mail'));
}
示例10: Init
/**
* Инициализация
*/
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('text', 'string', 'max' => Config::Get('module.user.usernote_text_max'), 'min' => 1, 'allowEmpty' => false);
}
示例11: Init
/**
* Инициализация
*/
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('text', 'string', 'max' => Config::Get('module.wall.text_max'), 'min' => Config::Get('module.wall.text_min'), 'allowEmpty' => false, 'on' => array('', 'add'));
}
示例12: Init
public function Init()
{
parent::Init();
$this->aValidateRules[] = array('type_code', 'string', 'min' => 2, 'max' => 10, 'allowEmpty' => false, 'label' => E::ModuleLang()->Get('action.admin.blogtypes_typecode'), 'on' => array('add'));
}
示例13: Init
/**
* Инициализация
*/
public function Init()
{
parent::Init();
$this->aBehaviors['category']['validate_require'] = !Config::Get('module.blog.category_allow_empty');
$this->aBehaviors['category']['validate_only_without_children'] = Config::Get('module.blog.category_only_without_children');
}