_getReferenceMapNormalized example


    public function getReference($tableClassname$ruleKey = null)
    {
        $thisClass = get_class($this);
        if ($thisClass === 'Zend_Db_Table') {
            $thisClass = $this->_definitionConfigName;
        }
        $refMap = $this->_getReferenceMapNormalized();
        if ($ruleKey !== null) {
            if (!isset($refMap[$ruleKey])) {
                throw new Zend_Db_Table_Exception("No reference rule \"$ruleKey\" from table $thisClass to table $tableClassname");
            }
            if ($refMap[$ruleKey][self::REF_TABLE_CLASS] != $tableClassname) {
                throw new Zend_Db_Table_Exception("Reference rule \"$ruleKey\" does not reference table $tableClassname");
            }
            return $refMap[$ruleKey];
        }
        foreach ($refMap as $reference) {
            if ($reference[self::REF_TABLE_CLASS] == $tableClassname) {
                

class Enlight_Components_Table extends Zend_Db_Table implements Enlight_Hook
{
    /** * Returns a normalized version of the reference map * * @return array */
    protected function _getReferenceMapNormalized()
    {
        $maps = parent::_getReferenceMapNormalized();
        foreach ($maps as $rule => $map) {
            if (isset($map[self::REF_TABLE_CLASS])) {
                $maps[$rule][self::REF_TABLE_CLASS] = Enlight_Class::getClassName($map[self::REF_TABLE_CLASS]);
            }
        }

        return $maps;
    }
}
Home | Imprint | This part of the site doesn't use cookies.