本文整理汇总了PHP中Doctrine\ORM\Query\Parser::ArithmeticExpression方法的典型用法代码示例。如果您正苦于以下问题:PHP Parser::ArithmeticExpression方法的具体用法?PHP Parser::ArithmeticExpression怎么用?PHP Parser::ArithmeticExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\Query\Parser
的用法示例。
在下文中一共展示了Parser::ArithmeticExpression方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
// Add the concat separator to the values array.
$this->values[] = $parser->ArithmeticExpression();
// Add the rest of the strings to the values array. CONCAT_WS must
// be used with at least 2 strings not including the separator.
$lexer = $parser->getLexer();
while (count($this->values) < 3 || $lexer->lookahead['type'] == Lexer::T_COMMA) {
$parser->match(Lexer::T_COMMA);
$peek = $lexer->glimpse();
$this->values[] = $peek['value'] == '(' ? $parser->FunctionDeclaration() : $parser->ArithmeticExpression();
}
while ($lexer->lookahead['type'] == Lexer::T_IDENTIFIER) {
switch (strtolower($lexer->lookahead['value'])) {
case 'notempty':
$parser->match(Lexer::T_IDENTIFIER);
$this->notEmpty = true;
break;
default:
// Identifier not recognized (causes exception).
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
break;
}
}
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例2: parse
/**
* @param \Doctrine\ORM\Query\Parser $parser
* @return void
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->date = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->format = $this->convertFormat($parser->ArithmeticExpression());
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例3: parse
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->expr1 = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->expr2 = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例4: parse
public function parse(Parser $parser)
{
$parser->Match(Lexer::T_IDENTIFIER);
$parser->Match(Lexer::T_OPEN_PARENTHESIS);
$this->dateExpression = $parser->ArithmeticExpression();
$parser->Match(Lexer::T_COMMA);
$this->formatChar = $parser->ArithmeticExpression();
$parser->Match(Lexer::T_CLOSE_PARENTHESIS);
}
示例5: parse
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->latitude = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->center = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->distance = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例6: parse
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->condition = $parser->ConditionalExpression();
$parser->match(Lexer::T_COMMA);
$this->isTrueStatement = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->isFalseStatement = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例7: parse
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->firstValue = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->secondValue = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->thirdValue = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例8: parse
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->expressions[] = $parser->ConditionalExpression();
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例9: parse
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->values[] = $parser->ArithmeticExpression();
$lexer = $parser->getLexer();
while (count($this->values) < 2 || $lexer->lookahead['type'] != Lexer::T_CLOSE_PARENTHESIS) {
$parser->match(Lexer::T_COMMA);
$this->values[] = $parser->ArithmeticExpression();
}
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例10: parse
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
$lexer = $parser->getLexer();
$parser->match(\Doctrine\ORM\Query\Lexer::T_IDENTIFIER);
$parser->match(\Doctrine\ORM\Query\Lexer::T_OPEN_PARENTHESIS);
$this->firstExpression = $parser->ArithmeticExpression();
if (\Doctrine\ORM\Query\Lexer::T_COMMA === $lexer->lookahead['type']) {
$parser->match(\Doctrine\ORM\Query\Lexer::T_COMMA);
$this->secondExpression = $parser->ArithmeticExpression();
}
$parser->match(\Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS);
}
示例11: parse
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->latOrigin = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->lngOrigin = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->latDestination = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->lngDestination = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例12: parse
public function parse(Doctrine\ORM\Query\Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->fromLatitude = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->fromLongitude = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->toLatitude = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->toLongitude = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例13: parse
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->latOrigin = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->lonOrigin = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->latPoint = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->lonPoint = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->distance = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
示例14: parse
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
// (2)
$parser->match(Lexer::T_OPEN_PARENTHESIS);
// (3)
$this->nb = $parser->ArithmeticExpression();
// (4)
$parser->match(Lexer::T_COMMA);
// (3)
$this->format = $parser->ArithmeticExpression();
// (4)
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
// (3)
}
示例15: parse
/**
* {@inheritdoc}
*/
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->parameters[self::PARAMETER_KEY] = $parser->ArithmeticExpression();
$parser->match(Lexer::T_AS);
$parser->match(Lexer::T_IDENTIFIER);
$lexer = $parser->getLexer();
$type = $lexer->token['value'];
if ($lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
$parser->match(Lexer::T_OPEN_PARENTHESIS);
/** @var Literal $parameter */
$parameter = $parser->Literal();
$parameters = array($parameter->value);
if ($lexer->isNextToken(Lexer::T_COMMA)) {
while ($lexer->isNextToken(Lexer::T_COMMA)) {
$parser->match(Lexer::T_COMMA);
$parameter = $parser->Literal();
$parameters[] = $parameter->value;
}
}
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$type .= '(' . implode(', ', $parameters) . ')';
}
if (!$this->checkType($type)) {
$parser->syntaxError(sprintf('Type unsupported. Supported types are: "%s"', implode(', ', $this->supportedTypes)), $lexer->token);
}
$this->parameters[self::TYPE_KEY] = $type;
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}