当前位置: 首页>>代码示例>>PHP>>正文


PHP OptionsArray::build方法代码示例

本文整理汇总了PHP中SqlParser\Components\OptionsArray::build方法的典型用法代码示例。如果您正苦于以下问题:PHP OptionsArray::build方法的具体用法?PHP OptionsArray::build怎么用?PHP OptionsArray::build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SqlParser\Components\OptionsArray的用法示例。


在下文中一共展示了OptionsArray::build方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: build

 /**
  * @return string
  */
 public function build()
 {
     $ret = OptionsArray::build($this->options);
     if ($this->type === TransactionStatement::TYPE_BEGIN) {
         foreach ($this->statements as $statement) {
             $ret .= ';' . $statement->build();
         }
         $ret .= ';' . $this->end->build();
     }
     return $ret;
 }
开发者ID:scriptpazar,项目名称:phpmyadmin,代码行数:14,代码来源:TransactionStatement.php

示例2: build

 /**
  * @return string
  */
 public function build()
 {
     $ret = 'DELETE ' . OptionsArray::build($this->options);
     if ($this->columns != NULL && count($this->columns) > 0) {
         $ret .= ' ' . ExpressionArray::build($this->columns);
     }
     if ($this->from != NULL && count($this->from) > 0) {
         $ret .= ' FROM ' . ExpressionArray::build($this->from);
     }
     if ($this->using != NULL && count($this->using) > 0) {
         $ret .= ' USING ' . ExpressionArray::build($this->using);
     }
     if ($this->where != NULL && count($this->where) > 0) {
         $ret .= ' WHERE ' . Condition::build($this->where);
     }
     if ($this->order != NULL && count($this->order) > 0) {
         $ret .= ' ORDER BY ' . ExpressionArray::build($this->order);
     }
     if ($this->limit != NULL && count($this->limit) > 0) {
         $ret .= ' LIMIT ' . Limit::build($this->limit);
     }
     return $ret;
 }
开发者ID:wp-cloud,项目名称:phpmyadmin,代码行数:26,代码来源:DeleteStatement.php

示例3: build

 /**
  * @return string
  */
 public function build()
 {
     $fields = '';
     if (!empty($this->fields)) {
         if (is_array($this->fields)) {
             $fields = CreateDefinition::build($this->fields) . ' ';
         } elseif ($this->fields instanceof ArrayObj) {
             $fields = ArrayObj::build($this->fields);
         }
     }
     if ($this->options->has('DATABASE')) {
         return 'CREATE ' . OptionsArray::build($this->options) . ' ' . Expression::build($this->name) . ' ' . OptionsArray::build($this->entityOptions);
     } elseif ($this->options->has('TABLE')) {
         $partition = '';
         if (!empty($this->partitionBy)) {
             $partition .= "\nPARTITION BY " . $this->partitionBy;
         }
         if (!empty($this->partitionsNum)) {
             $partition .= "\nPARTITIONS " . $this->partitionsNum;
         }
         if (!empty($this->subpartitionBy)) {
             $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy;
         }
         if (!empty($this->subpartitionsNum)) {
             $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum;
         }
         if (!empty($this->partitions)) {
             $partition .= "\n" . PartitionDefinition::build($this->partitions);
         }
         return 'CREATE ' . OptionsArray::build($this->options) . ' ' . Expression::build($this->name) . ' ' . $fields . OptionsArray::build($this->entityOptions) . $partition;
     } elseif ($this->options->has('VIEW')) {
         return 'CREATE ' . OptionsArray::build($this->options) . ' ' . Expression::build($this->name) . ' ' . $fields . ' AS ' . TokensList::build($this->body) . ' ' . OptionsArray::build($this->entityOptions);
     } elseif ($this->options->has('TRIGGER')) {
         return 'CREATE ' . OptionsArray::build($this->options) . ' ' . Expression::build($this->name) . ' ' . OptionsArray::build($this->entityOptions) . ' ' . 'ON ' . Expression::build($this->table) . ' ' . 'FOR EACH ROW ' . TokensList::build($this->body);
     } elseif ($this->options->has('PROCEDURE') || $this->options->has('FUNCTION')) {
         $tmp = '';
         if ($this->options->has('FUNCTION')) {
             $tmp = 'RETURNS ' . DataType::build($this->return);
         }
         return 'CREATE ' . OptionsArray::build($this->options) . ' ' . Expression::build($this->name) . ' ' . ParameterDefinition::build($this->parameters) . ' ' . $tmp . ' ' . TokensList::build($this->body);
     } else {
         return 'CREATE ' . OptionsArray::build($this->options) . ' ' . Expression::build($this->name) . ' ' . TokensList::build($this->body);
     }
     return '';
 }
开发者ID:FuhrerMalkovich,项目名称:Blogpost,代码行数:48,代码来源:CreateStatement.php

示例4: testBuild

 public function testBuild()
 {
     $component = new OptionsArray(array('ALL', 'SQL_CALC_FOUND_ROWS', array('name' => 'MAX_STATEMENT_TIME', 'value' => '42', 'equals' => true)));
     $this->assertEquals(OptionsArray::build($component), 'ALL SQL_CALC_FOUND_ROWS MAX_STATEMENT_TIME=42');
 }
开发者ID:elrossco22,项目名称:sql-parser,代码行数:5,代码来源:OptionsArrayTest.php

示例5: build

 /**
  * @param FieldDefinition|FieldDefinition[] $component The component to be built.
  *
  * @return string
  */
 public static function build($component)
 {
     if (is_array($component)) {
         $ret = array();
         foreach ($component as $c) {
             $ret[] = static::build($c);
         }
         return "(\n" . implode(",\n", $ret) . "\n)";
     } else {
         $tmp = '';
         if ($component->isConstraint) {
             $tmp .= 'CONSTRAINT ';
         }
         if (!empty($component->name)) {
             $tmp .= Context::escape($component->name) . ' ';
         }
         if (!empty($component->type)) {
             $tmp .= DataType::build($component->type) . ' ';
         }
         if (!empty($component->key)) {
             $tmp .= Key::build($component->key) . ' ';
         }
         if (!empty($component->references)) {
             $tmp .= 'REFERENCES ' . Reference::build($component->references) . ' ';
         }
         $tmp .= OptionsArray::build($component->options);
         return trim($tmp);
     }
 }
开发者ID:saisai,项目名称:phpmyadmin,代码行数:34,代码来源:FieldDefinition.php

示例6: build

 /**
  * @param Key $component The component to be built.
  *
  * @return string
  */
 public static function build($component)
 {
     $ret = $component->type . ' ';
     if (!empty($component->name)) {
         $ret .= Context::escape($component->name) . ' ';
     }
     $ret .= '(' . implode(',', Context::escape($component->columns)) . ')';
     $ret .= OptionsArray::build($component->options);
     return trim($ret);
 }
开发者ID:WSDC-NITWarangal,项目名称:phpmyadmin,代码行数:15,代码来源:Key.php

示例7: build

 /**
  * @param AlterOperation $component The component to be built.
  *
  * @return string
  */
 public static function build($component)
 {
     $ret = OptionsArray::build($component->options) . ' ';
     if (!empty($component->field)) {
         $ret .= Expression::build($component->field) . ' ';
     }
     $ret .= TokensList::build($component->unknown);
     return $ret;
 }
开发者ID:rushi963,项目名称:phpmyadmin,代码行数:14,代码来源:AlterOperation.php

示例8: build

 /**
  * @return string
  */
 public function build()
 {
     $tmp = array();
     foreach ($this->altered as $altered) {
         $tmp[] = $altered::build($altered);
     }
     return 'ALTER ' . OptionsArray::build($this->options) . ' TABLE ' . Expression::build($this->table) . ' ' . implode(', ', $tmp);
 }
开发者ID:urstrulymahesh,项目名称:phpmyadmin,代码行数:11,代码来源:AlterStatement.php

示例9: build

 /**
  * @param DataType $component The component to be built.
  *
  * @return string
  */
 public static function build($component)
 {
     $tmp = '';
     if (!empty($component->parameters)) {
         $tmp = '(' . implode(',', $component->parameters) . ')';
     }
     return trim(strtolower($component->name) . $tmp . ' ' . OptionsArray::build($component->options));
 }
开发者ID:WSDC-NITWarangal,项目名称:phpmyadmin,代码行数:13,代码来源:DataType.php

示例10: build

 /**
  * @param Reference $component The component to be built.
  *
  * @return string
  */
 public static function build($component)
 {
     return trim(Context::escape($component->table) . ' (' . implode(', ', Context::escape($component->columns)) . ') ' . OptionsArray::build($component->options));
 }
开发者ID:WSDC-NITWarangal,项目名称:phpmyadmin,代码行数:9,代码来源:Reference.php

示例11: build

 /**
  * @return string
  */
 public function build()
 {
     return 'SET ' . OptionsArray::build($this->options) . ' ' . SetOperation::build($this->set);
 }
开发者ID:phpmyadmin,项目名称:sql-parser,代码行数:7,代码来源:SetStatement.php


注:本文中的SqlParser\Components\OptionsArray::build方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。