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
没有评论:
发表评论