本文整理汇总了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);
}