Login +

Documentation

SLS_FrontModelSql::searchModels

Since SillySmart 1.0

Description

Search of n objects of models
public array searchModels ( [ string $table ] , [ array $joins ] , [ array $clause ] , [ array $group ] , [ mixed $order ] , [ array $limit ] );

Parameters

  • string $table
    the current table to list (default: empty => current model)
  • array $joins
    the table(s) to join with current table (default: empty => no join) If you want to natural join: array("table_2","table_3","...","table_n") will give 'SELECT * FROM table_1 NATURAL JOIN table_2 NATURAL JOIN table_3 ... NATURAL JOIN table_n' If you want to join with a specific column: array(0=>array("table"=>"table_2","column"=>"column_2"),1=>array("table"=>"table_3","column"=>"column_3"))
  • array $clause
    the clause wanted (default: empty => no clause) array ( [0] => array ( ["column"] = "column_1", ["value"] = "value_1", // or array('value1','value2','...','valueN') if "in" mode ["mode"]= "like" or "notlike" or "beginwith" or "endwith" or "equal" or "notequal" or "lt" or "le" or "ge" or "gt" or "null" or "notnull" or "in" ) [1] => array ( ["column"] = "user_department", ["value"] = "75", // or array('value1','value2','...','valueN') if "in" mode ["mode"]= "like" or "notlike" or "beginwith" or "endwith" or "equal" or "notequal" or "lt" or "le" or "ge" or "gt" or "null" or "notnull" or "in" ) )
  • array $group
    a group by (default: empty => no group by) array("column_1","column_2","...","column_n")
  • mixed $order
    the order you want (default: empty => ORDER BY primary key ASC) array ( [0] => array ( ["column"] = "column_1", ["order"]= "asc" ) [1] => array ( ["column"] = "column_2", ["order"]= "desc" ) ) or string "rand()"
  • array $limit
    the limit you want (default: empty for all recordsets) array("start" => "10", "length" => "30")

Return

array
PDO Object
No exemples.

Comments

No comment on this function, be the first !

Add your comment

You must login/register to post a reply.