gyro/core/lib/interfaces/idbwhereholder.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Interface for things that have where clauses 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup Interfaces 00007 */ 00008 interface IDBWhereHolder { 00009 /** 00010 * Adds where to this 00011 * 00012 * Example: 00013 * 00014 * $object = new mytable(); 00015 * $object->add_where('id', '>', 3); 00016 * $object->add_where('name', 'in', array('Hans', 'Joe')); 00017 * $object->add_where("(email like '%provider1%' or email like '%provider2%')"); 00018 * 00019 * Will query using the following SQL: 00020 * 00021 * SELECT * FROM mytable WHERE (id > 3 AND name IN ('Hans', 'Joe') AND (email like '%provider1%' or email like '%provider2%')); 00022 * 00023 * @param string $column Column to query upon, or a full sql where statement 00024 * @param string $operator Operator to execute 00025 * @param mixed $value Value(s) to use 00026 * @mode string Either IDBWhere::OP_AND or DBWhere::OP_OR 00027 */ 00028 public function add_where($column, $operator = null, $value = null, $mode = 'AND'); 00029 00030 /** 00031 * Adds IDBWhere instance to this 00032 */ 00033 public function add_where_object(IDBWhere $where); 00034 00035 /** 00036 * Returns root collection of wheres 00037 * 00038 * @return DBWhereGroup 00039 */ 00040 public function get_wheres(); 00041 }