Login +

Documentation

SLS_FrontModelSql::countModels

Since SillySmart 1.0

Description

TABLE NAME//TABLE NAME/JOINS//JOINS/CLAUSE//CLAUSE/GROUP BY//GROUP BY/ORDER//ORDER/LIMIT//LIMIT/Count the number of objects of models
public int countModels ( string $table, [ array $joins ] , [ array $clause ] , [ array $group ] );

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")

Return

int
the number of objects within limit
No exemples.

Comments

No comment on this function, be the first !

Add your comment

You must login/register to post a reply.