本文整理汇总了PHP中Query::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::add方法的具体用法?PHP Query::add怎么用?PHP Query::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query
的用法示例。
在下文中一共展示了Query::add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addUser
public function addUser($conexion, $email, $nombre, $apellido, $edad, $genero, $grado, $password)
{
$roll = 3;
$active = 0;
$query = new Query();
$query->add($this->table, $conexion, $email, $nombre, $apellido, $edad, $genero, $grado, $password, $roll, $active);
}
示例2: add
function add($params)
{
$game = new Game();
foreach ($game as $key => $value) {
if (isset($params[$key])) {
$game->{$key} = $params[$key];
}
}
$game = Query::add($game);
return $game;
}
示例3: add
function add($params)
{
$arena = new Arena();
foreach ($arena as $key => $value) {
if (isset($params[$key])) {
$arena->{$key} = $params[$key];
}
}
$arena = Query::add($arena);
return $arena;
}
示例4: add
function add($params)
{
$user = new User();
foreach ($user as $key => $value) {
if (isset($params[$key])) {
$user->{$key} = $params[$key];
}
}
$user = Query::add($user);
return $user;
}
示例5: Query
function testGetTablesClauseMultipleTablesWithJoin()
{
$q = new Query('Article');
$q->join('UserCard', 'Article.CardID = UserCard.CardID AND UserCard.UserID = 2', Query::LEFT_JOIN);
$q->add('UserCard.CardID', null, Query::IS_NULL);
$q->join('CardPicture');
$q->group('Article.CardID');
$q->addOrder('Title', 'DESC');
$this->assertEquals(preg_replace('/\\s/', '', 'SELECT `Article`.*
FROM (`Article`, `CardPicture`)
LEFT JOIN `UserCard` ON (Article.CardID = UserCard.CardID AND UserCard.UserID = 2)
WHERE `UserCard`.`CardID` IS NULL
GROUP BY `Article`.`CardID`
ORDER BY `Title` DESC'), preg_replace('/\\s/', '', $q->getQuery() . ''));
}
示例6: Query
<?php
//New query
$q = new Query();
$q->add('Column', 'Value');
//Limit results per page
$limit = 50;
//Specify the current page
$page = 2;
//Create instance of pager, provide the name of the DABL class
$pager = new QueryPager($q, $limit, $page, 'Inspection');
//Retrieve an array of Objects from the DABL class for that page
$inspections = $pager->fetchPage();
示例7: getForeignObjectsQuery
/**
* @param string $foreign_table
* @param string $foreign_column
* @param Query $q
* @return Query
*/
protected function getForeignObjectsQuery($foreign_table, $foreign_column, $local_column, Query $q = null)
{
$value = $this->{"get{$local_column}"}();
if (null === $value) {
throw new RuntimeException('NULL cannot be used to match keys.');
}
$column = "{$foreign_table}.{$foreign_column}";
if ($q) {
$q = clone $q;
$alias = $q->getAlias();
if ($alias && $foreign_table == $q->getTable()) {
$column = "{$alias}.{$foreign_column}";
}
} else {
$q = new Query();
}
$q->add($column, $value);
return $q;
}