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


PHP ORM::__construct方法代码示例

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


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

示例1:

 function __construct($id = NULL)
 {
     parent::__construct($id);
     // if($this->id!=true) {
     // $this->where("web_type_id",1);
     // }
 }
开发者ID:ultraauchz,项目名称:asean_cultural_mapping,代码行数:7,代码来源:contents.php

示例2: __construct

 public function __construct($data = [])
 {
     parent::__construct($data);
     if ($this->createdAt) {
         $this->createdAt = DateTime::createFromFormat('Y-m-d H:i:s', $this->createdAt);
     }
 }
开发者ID:elagith,项目名称:learningMaterial,代码行数:7,代码来源:User.php

示例3: __construct

 public function __construct($id)
 {
     // load database library into $this->db (can be omitted if not required)
     parent::__construct($id);
     // Set the UNIX timestamp for use with the created field
     $this->now = time();
 }
开发者ID:kolanos,项目名称:kohana-tags,代码行数:7,代码来源:tagging.php

示例4: __construct

 public function __construct($data)
 {
     parent::__construct();
     if ($data && sizeof($data)) {
         $this->populateFromRow($data);
     }
 }
开发者ID:cgarcialogrono,项目名称:localizador_tiendas,代码行数:7,代码来源:Icono.php

示例5: __construct

 /**
  * Load the default column names.
  *
  * @access  public
  * @param   mixed   parameter for find or object to load
  * @return  void
  */
 public function __construct($id = NULL)
 {
     if (!isset($this->_sorting)) {
         $this->_sorting = array($this->left_column => 'ASC');
     }
     parent::__construct($id);
 }
开发者ID:boomcms,项目名称:orm-mptt,代码行数:14,代码来源:MPTT.php

示例6: __construct

 /**
  * Constructs a wrapper for a table.  Called by Model instances.
  */
 public function __construct($table_name)
 {
     self::_setup_db();
     parent::__construct($table_name);
     // Until find_one or find_many are called, this object is considered a new row
     $this->create();
 }
开发者ID:powerpak,项目名称:dakota,代码行数:10,代码来源:dakota.php

示例7: __construct

 public function __construct($id = NULL)
 {
     parent::__construct($id);
     if (!$this->loaded()) {
         $this->payment_date = time();
     }
 }
开发者ID:halkeye,项目名称:ecmproject,代码行数:7,代码来源:payment.php

示例8: __construct

 public function __construct($id = null)
 {
     parent::__construct($id);
     if (!$this->loaded()) {
         // Set reasonable defaults
         $this->count = 0;
     }
 }
开发者ID:JasonWiki,项目名称:docs,代码行数:8,代码来源:tag.php

示例9: __construct

 public function __construct($id = NULL)
 {
     parent::__construct($id);
     $lat = Kohana::config('distance.lat');
     $lon = Kohana::config('distance.lon');
     $distance_calc = "(((acos(sin((" . $lat . "*pi()/180)) * sin((`PositionLat`*pi()/180))+cos((" . $lat . "*pi()/180)) * cos((`PositionLat`*pi()/180)) * cos(((" . $lon . "- `PositionLon`)*pi()/180))))*180/pi())*60*1.1515)";
     $this->sorting = array(array('column' => $distance_calc, 'direction' => 'ASC'));
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:8,代码来源:distance.php

示例10: __construct

 public function __construct($id = NULL)
 {
     parent::__construct($id);
     if (!$this->loaded()) {
         $this->created = time();
         /* Set a default status on new user creation */
         $this->status = Model_Account::ACCOUNT_STATUS_UNVERIFIED;
     }
 }
开发者ID:halkeye,项目名称:ecmproject,代码行数:9,代码来源:account.php

示例11: load

 /**
  * Loads up a specific list table ORM instance
  * @param   string      name of the list to load
  * @return  Model_List
  */
 public function load($list_name)
 {
     $list = KMS::instance('site')->lists->where('name', '=', $list_name)->find();
     if (!$list->loaded()) {
         throw new KMS_Exception('Unable to load list `:list:`', array(':list:' => $list_name));
     }
     $this->_table_name = 'list_' . KMS::instance('site')->id . '_' . strtolower($list->name);
     parent::__construct($this->_passed_id);
     return $this;
 }
开发者ID:ngonchan,项目名称:Kooshy,代码行数:15,代码来源:list.php

示例12: __construct

 /**
  * Load the default column names
  *
  * @param   mixed  $id  Parameter for find or object to load [Optional]
  * @uses    Arr::unshift
  */
 public function __construct($id = NULL)
 {
     if (empty($this->_sorting)) {
         $this->_sorting = array($this->scope_column => 'ASC', $this->left_column => 'ASC');
     } else {
         $this->_sorting = Arr::unshift($this->_sorting, $this->left_column, 'ASC');
         $this->_sorting = Arr::unshift($this->_sorting, $this->scope_column, 'ASC');
     }
     parent::__construct($id);
 }
开发者ID:ultimateprogramer,项目名称:cms,代码行数:16,代码来源:mptt.php

示例13: __construct

 /**
  * Construct
  *
  * @param   mixed  $id
  * @return  void
  */
 public function __construct($id = null)
 {
     if (!is_object($this->cache)) {
         $this->cache = Cache::instance($this->cache);
     }
     if (empty($id)) {
         $id = null;
     }
     parent::__construct($id);
 }
开发者ID:anqqa,项目名称:Anqh,代码行数:16,代码来源:Modeler_ORM.php

示例14: __construct

 /**
  * Load the default column names.
  *
  * @access  public
  * @param   mixed   parameter for find or object to load
  * @return  void
  */
 public function __construct($id = NULL)
 {
     $config = Kohana::config('mptt');
     foreach ($config as $param => $value) {
         $this->{$param} = $value;
     }
     if (!isset($this->_sorting)) {
         $this->_sorting = array($this->left_column => 'ASC');
     }
     parent::__construct($id);
 }
开发者ID:jbennett,项目名称:orm-mptt,代码行数:18,代码来源:mptt.php

示例15: __construct

 public function __construct($id = NULL)
 {
     try {
         // Check to see if the table exists
         return parent::__construct($id);
     } catch (Kohana_Exception $e) {
         // The table does not exist, lets create it
         self::create_table();
         return parent::__construct($id);
     }
 }
开发者ID:rjmackay,项目名称:kohana-i18n-manager,代码行数:11,代码来源:translation.php


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