本文整理匯總了PHP中Zend_Db_Table::getRepresentedEntity方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Db_Table::getRepresentedEntity方法的具體用法?PHP Zend_Db_Table::getRepresentedEntity怎麽用?PHP Zend_Db_Table::getRepresentedEntity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Db_Table
的用法示例。
在下文中一共展示了Zend_Db_Table::getRepresentedEntity方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor
*
* @param Pandamp_BeanContext_Decoratable $mixed The table class to model, or the classname
* as a string of the model to decorate. The class will then try to
* load the class and instantiate it with no arguments.
* @param Pandamp_Filter_Input $filter An optional filter that gets processed before the
* data is returned. The flter will only be used if teh data is decorated as dto or entity
* @param boolean $strict if set to false, mising setters for any property available will not
* throw an exception
*
* @throws Exception
*/
public final function __construct($mixed, Pandamp_Filter_Input $filter = null, $strict = true)
{
$this->_filter = $filter;
$this->_strict = $strict;
if (is_string($mixed)) {
Pandamp_BeanContext_Inspector::loadClass($mixed);
if (!class_exists($mixed)) {
throw new Exception("Could not find class to decorate \"{$mixed}\".");
}
$this->_decoratedModel = new $mixed();
} else {
$this->_decoratedModel = $mixed;
}
if (!$this->_decoratedModel instanceof Pandamp_BeanContext_Decoratable) {
throw new Exception("Decorated class is no subclass of \"Pandamp_BeanContext_Decoratable\"");
}
$this->_decoratedMethods = $this->_decoratedModel->getDecoratableMethods();
$this->_entity = $this->_decoratedModel->getRepresentedEntity();
Pandamp_BeanContext_Inspector::loadClass($this->_entity);
if (!class_exists($this->_entity)) {
throw new Exception("Could not find entity \"" . $this->_entity . "\".");
}
$refC = new ReflectionClass($this->_entity);
if (!$refC->implementsInterface('Pandamp_BeanContext')) {
throw new Exception("Entity \"" . $this->_entity . "\" is not a \"Pandamp_BeanContext\"-class.");
}
}