phramework/database
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Phramework
    • Database
      • Operations

Classes

  • Create
  • Delete
  • Update

Class Create

Create operation for databases

Namespace: Phramework\Database\Operations
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 0.0.0
Located at Operations/Create.php

Methods summary

public static integer|array
# create( array|object $attributes, string $table, string|null $schema = null, integer $return = self::RETURN_ID )

Create a new record in database

Create a new record in database

Parameters

$attributes
Key-value array or object with records's attributes
$table
Table's name
$schema
[Optional] Table's schema, default is null for no schema
$return

Return method type - if RETURN_ID will return the id of last inserted record - if RETURN_RECORDS will return the inserted record - if RETURN_NUMBER_OF_RECORDS will return the number of records affected

Returns

integer|array

Throws

Phramework\Exceptions\ServerException

Todo

Check RETURNING id for another primary key attribute

Constants summary

integer RETURN_ID
# 1
integer RETURN_RECORDS
# 2
integer RETURN_NUMBER_OF_RECORDS
# 4
phramework/database API documentation generated by ApiGen