本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}