phpEZ v0.4.0

Index extends ObjAttribute
in package

Attribute to create a database index on a field.

Specifies the name of the index to be created during DDL generation. Multiple fields can share the same index name to create composite indexes.

Tags
subpackage

db

see
Model::ddl()
Attributes
#[Attribute]
\Attribute::TARGET_PROPERTY

Table of Contents

Properties

$name  : string

Methods

__construct()  : mixed
Initialize the index attribute.
of()  : static|false
Extract an attribute instance from a reflected property.

Properties

$name

public string $name

Methods

__construct()

Initialize the index attribute.

public __construct(string $name) : mixed
Parameters
$name : string

The name of the index to create. Must not be empty.

Tags
throws
InvalidArgumentException

If name is empty.

of()

Extract an attribute instance from a reflected property.

public static of(ReflectionProperty $field) : static|false

Searches the property's attributes for one matching this class name and instantiates it with the attribute's arguments.

Parameters
$field : ReflectionProperty

The property to inspect for attributes.

Return values
static|false

The attribute instance if found, false otherwise.

On this page

Search results