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