Zend_Db_Table_Abstract::fetchAll? How does he come in mij
RelationModel::fetchAll?
beberlei wrote:
>
> find() builds a WHERE clause as a string and gives it to fetchAll()
> with the appropriate conditions. Therefore your overwrite
> is false, because $select can also be a string and you don't check for
> that.
>
> On Saturday 07 February 2009 15:25:53 PHPScriptor wrote:
>> My RelationModel:
>>
>> class RelationModel extends Zend_Db_Table_Abstract {
>> protected $_name = 'relations';
>> protected $_primary = array('id');
>>
>> public function fetchAll($select=null) {
>> if(is_null($select))
>> $select = parent::select();
>>
>> $select->setIntegrityCheck(false); => this is the problem
>>
>> $select->from($this->_name)
>> ->joinLeft('common_countries',
>> 'common_countries.id=relations.country_id',
>> array('country)
>> )
>>
>> $results = parent::fetchAll($select);
>> return $results;
>> }
>>
>> My Controller:
>>
>> $model = new RelationModel();
>> $results = $model->find(1);
>>
>> it's returning : "Fatal error: Call to a member function
>> setIntegrityCheck() on a non-object in ..."
>> Why is it going in my 'RelationModel' and calls the function fetchAll?
>> Anyone had the same problem?
>>
>> -----
>> visit my website at http://www.phpscriptor.com/
>> http://www.phpscriptor.com/
>
> --
> Benjamin Eberlei
> http://www.beberlei.de
>
>
-----
visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/
--
View this message in context: http://www.nabble.com/Zend-DB-and-find-%28strange-behaviour%29-tp21888868p21889235.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论