【发布时间】:2013-11-06 14:49:29
【问题描述】:
Phalcon 文档中有这个:
http://docs.phalconphp.com/en/latest/reference/models.html#taking-advantage-of-relationships.
假设我有这样的代码:
public function initialize()
{
$this->hasMany("id", "RobotsParts", "robots_id");
}
/**
* Return the related "robots parts"
*
* @return \RobotsParts[]
*/
public function getRobotsParts($parameters=null)
{
return $this->getRelated('RobotsParts', $parameters);
}
我想知道缓存“->getRelated()”查找产生的内容的最佳方法是什么?意思是,如果它被多次调用,它不应该进入数据库。
谢谢!
【问题讨论】: