PHP Class Sleimanx2\Plastic\Map\Blueprint

Datei anzeigen Open project: sleimanx2/plastic Class Usage Examples

Protected Properties

Property Type Description
$commands array The commands that should be run for the type.
$fields array The fields that should be mapped.
$type string The type the blueprint describes.

Public Methods

Method Description
__construct ( $type, Closure $callback = null, null $index = null ) Blueprint constructor.
addField ( string $type, string $name, array $attributes = [] ) : Illuminate\Support\Fluent Add a new field to the blueprint.
binary ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a binary field to the map.
boolean ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a boolean field to the map.
build ( Connection $connection, Grammar $grammar ) : array Execute the blueprint against the database.
byte ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a byte numeric field to the map.
completion ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a completion field to the map.
create ( ) : Illuminate\Support\Fluent Indicate that the table needs to be created.
date ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a date field to the map.
double ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a double field to the map.
float ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a float field to the map.
getCommands ( ) : array Get the command fields.
getFields ( ) : array Get the registered fields.
integer ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add an integer field to the map.
ip ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add an IPv4 field to the map.
long ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a long numeric field to the map.
nested ( $field, Closure $callback ) : Illuminate\Support\Fluent Add a nested map.
object ( $field, Closure $callback ) : Illuminate\Support\Fluent Add a object map.
point ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a geo point field to the map.
shape ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a geo shape field to the map.
short ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a short numeric field to the map.
string ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a string field to the map.
toDSL ( Grammar $grammar ) : array Get the raw DSL statements for the blueprint.
tokenCount ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent Add a completion field to the map.

Protected Methods

Method Description
addCommand ( string $name, array $parameters = [] ) : Illuminate\Support\Fluent Add a new command to the blueprint.
createCommand ( string $name, array $parameters = [] ) : Illuminate\Support\Fluent Create a new Fluent command.

Method Details

__construct() public method

Blueprint constructor.
public __construct ( $type, Closure $callback = null, null $index = null )
$type
$callback Closure
$index null

addCommand() protected method

Add a new command to the blueprint.
protected addCommand ( string $name, array $parameters = [] ) : Illuminate\Support\Fluent
$name string
$parameters array
return Illuminate\Support\Fluent

addField() public method

Add a new field to the blueprint.
public addField ( string $type, string $name, array $attributes = [] ) : Illuminate\Support\Fluent
$type string
$name string
$attributes array
return Illuminate\Support\Fluent

binary() public method

Add a binary field to the map.
public binary ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

boolean() public method

Add a boolean field to the map.
public boolean ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

build() public method

Execute the blueprint against the database.
public build ( Connection $connection, Grammar $grammar ) : array
$connection Sleimanx2\Plastic\Connection
$grammar Grammar
return array

byte() public method

Add a byte numeric field to the map.
public byte ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

completion() public method

Add a completion field to the map.
public completion ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

create() public method

Indicate that the table needs to be created.
public create ( ) : Illuminate\Support\Fluent
return Illuminate\Support\Fluent

createCommand() protected method

Create a new Fluent command.
protected createCommand ( string $name, array $parameters = [] ) : Illuminate\Support\Fluent
$name string
$parameters array
return Illuminate\Support\Fluent

date() public method

Add a date field to the map.
public date ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

double() public method

Add a double field to the map.
public double ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

float() public method

Add a float field to the map.
public float ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

getCommands() public method

Get the command fields.
public getCommands ( ) : array
return array

getFields() public method

Get the registered fields.
public getFields ( ) : array
return array

integer() public method

Add an integer field to the map.
public integer ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

ip() public method

Add an IPv4 field to the map.
public ip ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

long() public method

Add a long numeric field to the map.
public long ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

nested() public method

Add a nested map.
public nested ( $field, Closure $callback ) : Illuminate\Support\Fluent
$field
$callback Closure
return Illuminate\Support\Fluent

object() public method

Add a object map.
public object ( $field, Closure $callback ) : Illuminate\Support\Fluent
$field
$callback Closure
return Illuminate\Support\Fluent

point() public method

Add a geo point field to the map.
public point ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

shape() public method

Add a geo shape field to the map.
public shape ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

short() public method

Add a short numeric field to the map.
public short ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

string() public method

Add a string field to the map.
public string ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

toDSL() public method

Get the raw DSL statements for the blueprint.
public toDSL ( Grammar $grammar ) : array
$grammar Grammar
return array

tokenCount() public method

Add a completion field to the map.
public tokenCount ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent

Property Details

$commands protected_oe property

The commands that should be run for the type.
protected array $commands
return array

$fields protected_oe property

The fields that should be mapped.
protected array $fields
return array

$type protected_oe property

The type the blueprint describes.
protected string $type
return string