当前位置: 首页>>代码示例>>PHP>>正文


PHP Jelly::field方法代码示例

本文整理汇总了PHP中Jelly::field方法的典型用法代码示例。如果您正苦于以下问题:PHP Jelly::field方法的具体用法?PHP Jelly::field怎么用?PHP Jelly::field使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Jelly的用法示例。


在下文中一共展示了Jelly::field方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 public static function initialize(Jelly_Meta $meta)
 {
     // Set database to connect to
     $meta->db(Unittest_Jelly_Testcase::$database_connection);
     // Define fields
     $meta->fields(array('id' => Jelly::field('primary'), 'name' => Jelly::field('string'), 'test_posts' => Jelly::field('manytomany'), 'parent' => Jelly::field('belongsto', array('foreign' => 'test_category', 'column' => 'parent_id'))));
 }
开发者ID:piotrtheis,项目名称:jelly,代码行数:7,代码来源:category.php

示例2: initialize

 public static function initialize(Jelly_Meta $meta)
 {
     // Set database to connect to
     $meta->db(Unittest_Jelly_Testcase::$database_connection);
     // Define fields
     $meta->fields(array('id' => Jelly::field('primary'), 'name' => Jelly::field('string'), 'password' => Jelly::field('password'), 'email' => Jelly::field('email'), 'test_posts' => Jelly::field('hasmany'), 'test_post' => Jelly::field('hasone'), 'permission' => Jelly::field('belongsto', array('foreign' => 'test_role', 'column' => 'test_role_id')), '_id' => 'id'));
 }
开发者ID:piotrtheis,项目名称:jelly,代码行数:7,代码来源:author.php

示例3: initialize

 public static function initialize(Jelly_Meta $meta)
 {
     // Set database to connect to
     $meta->db(Unittest_Jelly_Testcase::$database_connection);
     // Define fields
     $meta->fields(array('id' => Jelly::field('primary'), 'name' => Jelly::field('string')));
 }
开发者ID:piotrtheis,项目名称:jelly,代码行数:7,代码来源:role.php

示例4: initialize

 public static function initialize(Jelly_Meta $meta)
 {
     // Set database to connect to
     $meta->db(Unittest_Jelly_Testcase::$database_connection);
     // All fields are aliased to different columns
     $meta->fields(array('id' => Jelly::field('primary', array('column' => 'id-alias')), 'name' => Jelly::field('string', array('column' => 'name-alias')), 'description' => Jelly::field('string', array('column' => 'description-alias')), '_id' => 'id', '_name' => 'name', '_description' => 'description', '_bar' => 'foo'));
 }
开发者ID:piotrtheis,项目名称:jelly,代码行数:7,代码来源:alias.php

示例5: set

 /**
  * Casts the returned value to a given type.
  *
  * @param   mixed   $value
  * @return  mixed
  */
 public function set($value)
 {
     if (isset($this->cast)) {
         // Cast the value using the field type defined in 'cast'
         $value = Jelly::field($this->cast)->set($value);
     }
     return $value;
 }
开发者ID:piotrtheis,项目名称:jelly,代码行数:14,代码来源:expression.php

示例6: initialize

 public static function initialize(Jelly_Meta $meta)
 {
     // Set database to connect to
     $meta->db(Unittest_Jelly_Testcase::$database_connection);
     // Posts always load_with an author
     $meta->load_with(array('test_author'));
     // Set fields
     $meta->fields(array('id' => Jelly::field('primary'), 'name' => Jelly::field('string'), 'slug' => Jelly::field('slug', array('unique' => TRUE)), 'status' => Jelly::field('enum', array('choices' => array('draft', 'published', 'review'))), 'created' => Jelly::field('timestamp', array('auto_now_create' => TRUE)), 'updated' => Jelly::field('timestamp', array('auto_now_update' => TRUE)), 'test_author' => Jelly::field('belongsto'), 'test_categories' => Jelly::field('manytomany'), 'approved_by' => Jelly::field('belongsto', array('foreign' => 'test_author.id', 'column' => 'approved_by')), '_id' => 'id', '_slug' => 'slug'));
 }
开发者ID:piotrtheis,项目名称:jelly,代码行数:9,代码来源:post.php

示例7: initialize

 /**
  * Initializating model meta information
  *
  * @param Jelly_Meta $meta
  */
 public static function initialize(Jelly_Meta $meta)
 {
     $meta->table('users')->fields(array('id' => Jelly::field('Primary'), 'email' => Jelly::field('Email'), 'name' => Jelly::field('String'), 'password' => Jelly::field('Password')));
 }
开发者ID:smgladkovskiy,项目名称:A1-auth,代码行数:9,代码来源:user.php

示例8: initialize

 /**
  * @param Jelly_Meta $meta
  */
 public static function initialize(Jelly_Meta $meta)
 {
     $meta->fields(array('id' => new Field_Primary(), 'username' => Jelly::field('string', array('unique' => TRUE, 'rules' => array(array('not_empty'), array('min_length', array(':value', 4)), array('max_length', array(':value', 4))))), 'password' => Jelly::field('password', array('hash_with' => array('Model_A1_User_Jelly', 'hash_password'), 'rules' => array(array('not_empty'), array('min_length', array(':value', 6)), array('max_length', array(':value', 50))))), 'password_confirm' => Jelly::field('password', array('in_db' => FALSE, 'rules' => array(array('not_empty'), array('min_length', array(':value', 6)), array('max_length', array(':value', 50)), array('matches', array(':validation', 'password', ':field')))))));
 }
开发者ID:wouterrr,项目名称:a1,代码行数:7,代码来源:Jelly.php


注:本文中的Jelly::field方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。