本文整理匯總了PHP中DatabaseConnection::insert方法的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseConnection::insert方法的具體用法?PHP DatabaseConnection::insert怎麽用?PHP DatabaseConnection::insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DatabaseConnection
的用法示例。
在下文中一共展示了DatabaseConnection::insert方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: insert
public static function insert($table, $fields, $values, $nestedRows = false, $rowsPerInsert = 100, $returnQueries = false)
{
if (!self::$default && self::$connectHandler) {
self::$connectHandler[0]->{self::$connectHandler[1]}();
}
return self::$default->insert($table, $fields, $values, $nestedRows, $rowsPerInsert, $returnQueries);
}
示例2: save
/**
* {@inheritdoc}
*/
public function save($source, $alias, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED, $pid = null)
{
$path = ['source' => $source, 'alias' => $alias, 'language' => $langcode];
if ($pid) {
$this->db->merge('url_alias')->key(['pid' => $pid])->fields($path)->execute();
$this->moduleHandler->invokeAll('path_update', [$path]);
$path['pid'] = $pid;
} else {
$this->db->insert('url_alias')->fields($path)->execute();
$this->moduleHandler->invokeAll('path_insert', [$path]);
}
\Drupal::service('path.alias_manager')->cacheClear($source);
return $path;
}
示例3: create
/**
* {@inheritdoc}
*/
public function create($name, array $values = [])
{
$exists = (bool) $this->db->query("SELECT 1 FROM {umenu} WHERE name = ?", [$name])->fetchField();
if ($exists) {
throw new \InvalidArgumentException(sprintf("%s: cannot create menu, already exists", $name));
}
$values['name'] = $name;
if (empty($values['title'])) {
$values['title'] = $name;
}
unset($values['id']);
$this->db->insert('umenu')->fields($values)->execute();
$menu = $this->load($name);
if ($this->dispatcher) {
$this->dispatcher->dispatch('menu:create', new GenericEvent($menu));
}
return $menu;
}
示例4: insert
public function insert($table, array $options = array())
{
return $this->connection->insert($table, $options);
}
示例5: insert
/**
* @see DatabaseConnection::insert
*/
public function insert($valspec, $valueArgs = null, $onDuplicate = null, $onDuplicateArgs = null)
{
return $this->dbc->insert($this->tblname, $valspec, $valueArgs, $onDuplicate, $onDuplicateArgs);
}