function init() { parent::init(); // We must select books which are either never been borrowed or have been returned $f = $this->join('library_borrowing.library_book_id', null, 'left')->addField('is_returned')->system(true); // Now that our relation is defined we can add custom condition with the OR clause. $this->addCondition($this->dsql()->orExpr()->where($f, 'is', null)->where($f, '1')); }
function init() { parent::init(); $this->a = $this->join('author'); $this->a->addField('email'); $this->a->addField('birth')->type('date'); }