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


PHP ORM::get方法代码示例

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


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

示例1: get

 /**
  * Add the optional last_topic column (only accessible if record_last_topic is true)
  *
  * @param string $column
  * @return mixed|ORM
  */
 public function get($column)
 {
     if ($column == 'last_topic' && parent::get('location')->record_last_topic == 1) {
         return ORM::factory('Quill_Topic')->where('category_id', '=', $this->id)->order_by('updated_at', 'DESC')->limit(1)->find();
     }
     return parent::get($column);
 }
开发者ID:happydemon,项目名称:quill,代码行数:13,代码来源:Category.php

示例2: get

 public function get($column)
 {
     if (array_key_exists($column, $this->_object)) {
         return parent::get($column);
     } elseif (isset($this->_related[$column])) {
         // Return related model that has already been fetched
         return $this->_related[$column];
     } elseif (isset($this->_belongs_to[$column])) {
         // Polymorphic relations
         if (Arr::get($this->_belongs_to[$column], 'polymorphic', FALSE) === TRUE) {
             $foreign_key = $this->polymorph_id();
             $foreign_type = $this->polymorph_type();
             $model = ORM::factory($this->_object[$foreign_type]);
             $col = $model->_object_name . '.' . $model->_primary_key;
             $val = $this->_object[$foreign_key];
         } else {
             $model = $this->_related($column);
             // Use this model's column and foreign model's primary key
             $col = $model->_object_name . '.' . $model->_primary_key;
             $val = $this->_object[$this->_belongs_to[$column]['foreign_key']];
         }
         // Make sure we don't run WHERE "AUTO_INCREMENT column" = NULL queries. This would
         // return the last inserted record instead of an empty result.
         // See: http://mysql.localhost.net.ar/doc/refman/5.1/en/server-session-variables.html#sysvar_sql_auto_is_null
         if ($val !== NULL) {
             $model->where($col, '=', $val)->find();
         }
         return $this->_related[$column] = $model;
     } else {
         return parent::get($column);
     }
 }
开发者ID:alshabalin,项目名称:kohana-advanced-orm,代码行数:32,代码来源:Polymorph.php

示例3: get

 public function get($col)
 {
     if ($col == $this->_created_column['column']) {
         return date(Kohana::$config->load('quill.time_format'), parent::get($col));
     }
     return parent::get($col);
 }
开发者ID:happydemon,项目名称:quill,代码行数:7,代码来源:Reply.php

示例4: get

 /**
  * Getter method, allows $model->get('property') access to data
  *
  * @param  string $property
  * @return string
  */
 public function get($property)
 {
     return $this->orm->get($property);
 }
开发者ID:florinp,项目名称:dexonline,代码行数:10,代码来源:paris.php

示例5: unset

    if ($_REQUEST[lti_launch_id]) {
        $launchid = $_REQUEST[lti_launch_id];
    } else {
        if (!empty($_SESSION['lti_launch_id'])) {
            $launchid = $_SESSION[lti_launch_id];
        } else {
            unset($_SESSION['lti_launch_id']);
            redirect_login();
            $launchid = false;
        }
    }
    if ($launchid) {
        $launch = new ORM("launch", false, "lti_launch");
        if (!$launch) {
            throw new Exception("LTI Runtime - Datebase unable to instance user");
        }
        $launch->get($launchid);
        if (!$launch->id()) {
            throw new Exception("LTI Runtime - Launch session not found");
        }
        $launchdata = $launch->data();
        $_SESSION['lti_launch_id'] = $launch->id();
        if ($launch && $launch->data()) {
            $LTI = new LTIObject($launch->data());
        }
    }
} catch (Exception $e) {
    DPRT($e->getMessage());
    redirect_login();
    $LTI = false;
}
开发者ID:csev,项目名称:cloudcollab,代码行数:31,代码来源:setup.php


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