public function findAllBySql($sql, $parameters = array()) { $args = func_num_args() > 1 ? array_slice(func_get_args(), 1) : null; $criteria = $this->getRecordCriteria($sql, $parameters, $args); $result = $this->getRecordGateway()->findRecordsBySql($this, $criteria); return $this->populateObjects($result); }