本文整理汇总了PHP中ORM::find方法的典型用法代码示例。如果您正苦于以下问题:PHP ORM::find方法的具体用法?PHP ORM::find怎么用?PHP ORM::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ORM
的用法示例。
在下文中一共展示了ORM::find方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find
public function find($id = NULL)
{
$p = parent::find($id);
// $p->shipping_info = (empty($p->shipping_info))? array() : unserialize($p->shipping_info);
$p->attributes = empty($p->attributes) ? array() : unserialize($p->attributes);
$p->options = empty($p->options) ? array() : unserialize($p->options);
$p->tax_ids = empty($p->tax_ids) ? array() : unserialize($p->tax_ids);
return $p;
}
示例2: find
public function find()
{
$this->where('prefix', '!=', Model_Location::RESERVED_LOCATION);
return parent::find();
}
示例3: find
/**
* Finds and loads a single database row into the object.
*
* @chainable
* @param mixed primary key or an array of clauses
* @return ORM
*/
public function find($id = NULL)
{
if (Kohana::config('versions.version') == 'max') {
$w = new Database_Expression('(SELECT max(version) FROM ' . $this->table_name . ' AS q WHERE ' . $this->table_name . '.pid=q.pid)');
} else {
$v = versions_helper::get_published_version();
$w = new Database_Expression('(SELECT max(version) FROM ' . $this->table_name . ' AS q WHERE ' . $this->table_name . '.pid=q.pid AND version <= ' . $v . ')');
}
$this->db->where('version', $w);
$this->db->where('state!=', 'D');
return parent::find($id);
}
示例4: find
public function find($id = NULL)
{
$res = parent::find($id);
$res->data = json_decode($res->data, TRUE);
return $res;
}
示例5: find
public function find($id)
{
$p = parent::find($id);
return $p;
}
示例6: latlon_from_city
/**
* get the lat/lon from a city
*
* @param string $city
* @return false/object
* @author Andy Bennett
*/
public function latlon_from_city($id = NULL, $city)
{
$this->like(array("district" => $city));
return parent::find($id);
}
示例7: find
/**
* Model_Base::find()
* apply filters and sorts before find
*
* @return
*/
public function find()
{
$this->apply_filters();
$this->apply_sorts();
$this->apply_amount();
$this->apply_skip();
return parent::find();
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:14,代码来源:Base.php