public function getGroupCollection() { if (is_null($this->_groupList)) { $filter = new Model_Group_Filter(); $filter->setIdSpeciality($this->getId()); $this->setGroupList(Model_DB_Group_Mapper::get_instance()->findByFilter($filter)); } return $this->_groupList; }
protected function getWhereClauseByFilter(Model_Group_Filter $filter) { $where = "1=1 "; $and = " AND "; $adapter = $this->getDbTable()->getAdapter(); if ($filter->getId()) { $where = $adapter->quoteInto(Model_DB_Group_Table::FIELDS_ID . " = ?", $filter->getId()); } else { $value = $filter->getName(); if (!empty($value)) { $where .= $and . $adapter->quoteInto(Model_DB_Group_Table::FIELDS_NAME . " LIKE ?", "%{$value}%"); } $value = $filter->getIdSpeciality(); if (!empty($value)) { $where .= $and . $adapter->quoteInto(Model_DB_Group_Table::FIELDS_ID_SPECIALITY_FK . " = ?", $value); } } return $where; }