00001 <?php
00002
00003
00004
00005
00006
00007
00008 class DBQueryInsert extends DBQuery {
00009
00010
00011
00012 const DELAYED = 1;
00013
00014
00015
00016 const IGNORE = 2;
00017
00018
00019
00020
00021
00022 protected $select_query = null;
00023
00024
00025
00026
00027
00028
00029 public function set_select(DBQuerySelect $query) {
00030 $this->select_query = $query;
00031 }
00032
00033
00034
00035
00036
00037
00038 public function get_select() {
00039 return $this->select_query;
00040 }
00041
00042
00043
00044
00045
00046
00047 public function get_sql() {
00048 $params = array();
00049 if ($this->policy & self::DELAYED) {
00050 $params['delayed'] = true;
00051 }
00052 if ($this->policy & self::IGNORE) {
00053 $params['ignore'] = true;
00054 }
00055 if (!empty($this->select_query)) {
00056 $params['select'] = $this->select_query;
00057 }
00058 $params['fields'] = $this->fields;
00059 $builder = DBSqlBuilderFactory::create_builder(DBSqlBuilderFactory::INSERT, $this, $params);
00060 return $builder->get_sql();
00061 }
00062 }