Exemplo n.º 1
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::entity(['is', '/vendor/boolive/basic/part'])->required(), 'page' => Rule::int()->default(1)->required()])]);
 }
Exemplo n.º 2
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::entity()->required(), 'page' => Rule::int()->default(1)->required(), 'page_count' => Rule::int()->more(1)->required()])]);
 }
Exemplo n.º 3
0
 /**
  * Правило на атрибуты
  * @return Rule
  */
 protected function rule()
 {
     return Rule::arrays(['name' => Rule::string()->regexp('|^[^/@:#\\\\]*$|')->min(IS_INSTALL ? 1 : 0)->max(100)->required(), 'parent' => Rule::any(Rule::uri(), Rule::null()), 'proto' => Rule::any(Rule::uri(), Rule::null()), 'author' => Rule::any(Rule::uri(), Rule::null()), 'order' => Rule::int()->max(Entity::MAX_ORDER), 'created' => Rule::int(), 'updated' => Rule::int(), 'value' => Rule::string()->max(65535), 'is_draft' => Rule::bool(), 'is_hidden' => Rule::bool(), 'is_mandatory' => Rule::bool(), 'is_property' => Rule::bool(), 'is_relative' => Rule::bool(), 'is_link' => Rule::bool(), 'is_default_value' => Rule::bool(), 'is_default_file' => Rule::bool(), 'is_default_logic' => Rule::bool(), 'file' => Rule::any([Rule::null(), Rule::string()->regexp('/[^\\/\\\\]+/ui'), Rule::arrays(['tmp_name' => Rule::string(), 'name' => Rule::lowercase()->ospatterns('*.*')->ignore('lowercase')->required(), 'size' => Rule::int(), 'error' => Rule::int()->eq(0, true), 'type' => Rule::string()])])]);
 }