_getTableFromString example

/** * Returns the class name of the given table * * @param string $tableName * * @return Zend_Db_Table_Abstract */
    protected function _getTableFromString($tableName)
    {
        $tableName = Enlight_Class::getClassName($tableName);

        return parent::_getTableFromString($tableName);
    }
}

    public function __construct(array $config = array())
    {
        if (isset($config['table']) && $config['table'] instanceof Zend_Db_Table_Abstract) {
            $this->_table = $config['table'];
            $this->_tableClass = get_class($this->_table);
        } elseif ($this->_tableClass !== null) {
            $this->_table = $this->_getTableFromString($this->_tableClass);
        }

        if (isset($config['data'])) {
            if (!is_array($config['data'])) {
                throw new Zend_Db_Table_Row_Exception('Data must be an array');
            }
            $this->_data = $config['data'];
        }
        if (isset($config['stored']) && $config['stored'] === true) {
            $this->_cleanData = $this->_data;
        }

        
Home | Imprint | This part of the site doesn't use cookies.