示例#1
0
 /**
  * Agregar una restricción para limitar los resultados a ser recuperados
  * @param Restrictions $restrictions
  * @return Criteria $this
  */
 public function add(Restrictions $restrictions)
 {
     if (!$this->flagCreateCtriteria) {
         throw new Exception('Necesita inicializar el criteria');
     }
     if (!is_array($this->array_restrictions)) {
         $this->array_restrictions = array("1" => $restrictions->getExpr());
     } else {
         array_push($this->array_restrictions, $restrictions->getExpr());
     }
     $this->SQL = MySQL_DB::instance()->DBSQLSelect($this->table, null, $this->array_restrictions, $this->array_order, $this->type_order, true);
     return $this;
 }