protected function buildSql(Criteria $criteria)
 {
     $query = "SELECT \n            id, name, status FROM %s\n            %s\n            LIMIT %d, %d\n        ";
     $where = array();
     $name = $criteria->getName();
     if ($name) {
         $where[] = sprintf('name = "%s"', $name);
     }
     $status = $criteria->getStatus();
     if ($status) {
         $where[] = sprintf('status = %d', $status);
     }
     $conditions = count($where) ? 'WHERE ' . explode(' AND ', $where) : '';
     $page = $criteria->getPage() ?: 1;
     $count = $criteria->getCount() ?: 5;
     return sprintf($query, $this->options['tableName'], $conditions, $page, $count);
 }