本文整理匯總了PHP中Zend_Db_Table_Abstract::getReference方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Db_Table_Abstract::getReference方法的具體用法?PHP Zend_Db_Table_Abstract::getReference怎麽用?PHP Zend_Db_Table_Abstract::getReference使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Db_Table_Abstract
的用法示例。
在下文中一共展示了Zend_Db_Table_Abstract::getReference方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _prepareReference
/**
* Prepares a table reference for lookup.
*
* Ensures all reference keys are set and properly formatted.
*
* @param Zend_Db_Table_Abstract $dependentTable
* @param Zend_Db_Table_Abstract $parentTable
* @param string $ruleKey
* @return array
*/
protected function _prepareReference(Zend_Db_Table_Abstract $dependentTable, Zend_Db_Table_Abstract $parentTable, $ruleKey)
{
$parentTableName = get_class($parentTable) === 'Zend_Db_Table' ? $parentTable->getDefinitionConfigName() : get_class($parentTable);
$map = $dependentTable->getReference($parentTableName, $ruleKey);
if (!isset($map[Zend_Db_Table_Abstract::REF_COLUMNS])) {
$parentInfo = $parentTable->info();
$map[Zend_Db_Table_Abstract::REF_COLUMNS] = array_values((array) $parentInfo['primary']);
}
$map[Zend_Db_Table_Abstract::COLUMNS] = (array) $map[Zend_Db_Table_Abstract::COLUMNS];
$map[Zend_Db_Table_Abstract::REF_COLUMNS] = (array) $map[Zend_Db_Table_Abstract::REF_COLUMNS];
return $map;
}
示例2: getReference
/**
* @param string $tableClassname
* @param string $ruleKey OPTIONAL
* @return array
* @throws Zend_Db_Table_Exception
*/
public function getReference($tableClassname, $ruleKey = null)
{
$tableClassname = str_replace('DbTable_', '', $tableClassname);
return parent::getReference($tableClassname, $ruleKey);
}
示例3: _prepareReference
/**
* Prepares a table reference for lookup.
*
* Ensures all reference keys are set and properly formatted.
*
* @param Zend_Db_Table_Abstract $dependentTable
* @param Zend_Db_Table_Abstract $parentTable
* @param string $ruleKey
* @return array
*/
protected function _prepareReference(Zend_Db_Table_Abstract $dependentTable, Zend_Db_Table_Abstract $parentTable, $ruleKey)
{
$map = $dependentTable->getReference(get_class($parentTable), $ruleKey);
if (!is_array($map[Zend_Db_Table_Abstract::COLUMNS])) {
$map[Zend_Db_Table_Abstract::COLUMNS] = (array) $map[Zend_Db_Table_Abstract::COLUMNS];
}
if (!isset($map[Zend_Db_Table_Abstract::REF_COLUMNS])) {
$parentInfo = $parentTable->info();
$map[Zend_Db_Table_Abstract::REF_COLUMNS] = (array) $parentInfo['primary'];
}
if (!is_array($map[Zend_Db_Table_Abstract::REF_COLUMNS])) {
$map[Zend_Db_Table_Abstract::REF_COLUMNS] = (array) $map[Zend_Db_Table_Abstract::REF_COLUMNS];
}
return $map;
}
示例4: _prepareReference
/**
* Prepares a table reference for lookup.
*
* Ensures all reference keys are set and properly formatted.
*
* @param Zend_Db_Table_Abstract $parentTable
* @param string $tableClass
* @param string $ruleKey
* @return array
*/
protected function _prepareReference(Zend_Db_Table_Abstract $table, $tableClass, $ruleKey)
{
$map = $table->getReference($tableClass, $ruleKey);
if (!is_array($map[Zend_Db_Table_Abstract::COLUMNS])) {
$map[Zend_Db_Table_Abstract::COLUMNS] = (array) $map[Zend_Db_Table_Abstract::COLUMNS];
}
if (!isset($map[Zend_Db_Table_Abstract::REF_COLUMNS])) {
$info = $table->info();
$map[Zend_Db_Table_Abstract::REF_COLUMNS] = $info['primary'];
}
if (!is_array($map[Zend_Db_Table_Abstract::REF_COLUMNS])) {
$map[Zend_Db_Table_Abstract::REF_COLUMNS] = (array) $map[Zend_Db_Table_Abstract::REF_COLUMNS];
}
return $map;
}