# Interfaces
# NelsonMartell\Collections\ICollection
Define métodos para manipular colecciones de objetos.
| Extends | \Iterator |
| Since | v0.1.1 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
# Constants
This interface has not constants.
# Methods
Agrega un elemento a la colección.
public function add( mixed $item ) : void
| Parameter | Type(s) | Description |
|---|---|---|
$item | mixed | Objeto que se va a agregar. |
Quita todos los elementos de la colección.
public function clear( ) : void
Description:
La propiedad Count se debe establecer en 0 y deben liberarse las referencias a otros objetos desde los elementos de la colección.
Determina si la colección contiene al elemento especificado.
public function contains( mixed $item ) : boolean
| Parameter | Type(s) | Description |
|---|---|---|
$item | mixed | Objeto que se va a buscar. |
Returns:
true si $item se encuentra; en caso contrario, false.
Obtiene el número de elementos incluidos en la colección.
public function getCount( ) : integer
Description:
Si extiende la clase NelsonMartell.Object, puede accederse desde la
propiedad Count.
| See also | \NelsonMartell\StrictObject |
Quita, si existe, la primera aparición de un objeto específico de la colección.
public function remove( mixed $item ) : boolean
| Parameter | Type(s) | Description |
|---|---|---|
$item | mixed | Objeto que se va a quitar. |
Returns:
true si el elemento se ha quitado correctamente; en
caso contrario, false. Este método también devuelve false si no
se encontró.
# NelsonMartell\Collections\IList
Representa una colección de objetos a los que se puede tener acceso por un índice.
| Extends | \Iterator NelsonMartell\Collections\ICollection |
| Since | v0.1.1 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
# Constants
This interface has not constants.
# Methods
Determina el índice de un elemento específico de la lista.
public function indexOf( mixed $item ) : integer
| Parameter | Type(s) | Description |
|---|---|---|
$item | mixed | Objeto que se va a buscar. |
Description:
Si un objeto aparece varias veces en la lista, el método indexOf siempre devolverá la primera instancia encontrada.
Returns:
Índice de $item si se encuentra en la lista; en caso contrario, -1.
Inserta un elemento en la lista, en el índice especificado.
public function insert( integer $index, mixed $item ) : void
| Parameter | Type(s) | Description |
|---|---|---|
$index | integer | Índice de base cero en el que debe insertarse $item. |
$item | mixed | Objeto que se va a insertar. |
Quita el elemento del índice especificado.
public function removeAt( integer $index ) : boolean
| Parameter | Type(s) | Description |
|---|---|---|
$index | integer | Índice de base cero del elemento que se va a quitar. |
Returns:
true si el elemento se ha quitado correctamente; en
caso contrario, false. Este método también devuelve false si no
se encontró.
# NelsonMartell\IComparable
Provides a generalized comparison method useful for sorting objects.
| Extends | Nothing |
| Since | v0.3.2 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
# Constants
This interface has not constants.
# Methods
Compares the current instance with another object and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public function compareTo( mixed $other ) : integer|null
| Parameter | Type(s) | Description |
|---|---|---|
$other | mixed | An object to compare with this instance. |
| See also | \NelsonMartell\IComparer::compare() |
Returns:
A value that indicates the relative order of the objects being compared. The return value has these meanings:
| Value | Meaning |
|---|---|
| Less than zero | This instance precedes $other in the sort order. |
0 | This instance occurs in the same position in the sort order as $other. |
| Greater than zero | This instance follows $other in the sort order. |
null | Indeterminated. If $other can't be compared with this instance. |
# NelsonMartell\IComparer
Exposes a method that compares two objects
| Extends | Nothing |
| Since | v0.6.0 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
| See also | \NelsonMartell\IComparable |
# Constants
This interface has not constants.
# Methods
Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
public static function compare( mixed $left, mixed $right ) : integer|null
| Parameter | Type(s) | Description |
|---|---|---|
$left | mixed | Object to which the relative position will be determined. |
$right | mixed | The second object to compare. |
Description:
Can be used as 2nd parameter of usort() function.
| See also | \usort() \NelsonMartell\IComparable::compareTo() |
Returns:
A value that indicates the relative order of the objects being compared. The return value has these meanings:
| Value | Meaning |
|---|---|
| Less than zero | This $left precedes $right in the sort order. |
0 | $left occurs in the same position in the sort order as $right. |
| Greater than zero | This instance follows $other in the sort order. |
null | Indeterminated. If $left and $right can't be compared to each other. |
# NelsonMartell\IConvertibleToJson
Provides methods to convert objets into JSON string.
| Extends | \JsonSerializable NelsonMartell\IConvertibleToString \Stringable |
| Since | v0.6.1 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
# Constants
This interface has not constants.
# Methods
# NelsonMartell\IConvertibleToString
Provides methods to convert objets into string representations.
| Extends | \Stringable |
| Since | v0.6.1 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
# Constants
This interface has not constants.
# Methods
Gets the implicit string representation of this instance.
public function __toString( ) : string
# NelsonMartell\ICustomPrefixedPropertiesContainer
Allows use custom getter/setter prefixes in a class in addition to default "get*" and "set*".
Access type of method should be marked as final since currently do not allows using multiple custom properties.
- Notes
- Avoid the use of custom prefixes. If you need to, maybe you could try to rename methods instead first.
| Extends | NelsonMartell\IStrictPropertiesContainer |
| Since | v0.6.0 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
| See also | \NelsonMartell\PropertiesHandler |
# Constants
This interface has not constants.
# Methods
getCustomGetterPrefix ( ) static
Gets the custom prefix for getters methods.
public static function getCustomGetterPrefix( ) : string
getCustomSetterPrefix ( ) static
Gets the custom prefix for setters methods.
public static function getCustomSetterPrefix( ) : string
# NelsonMartell\IEquatable
Provides a generalized method to compare equality of a class instance with a compatible object.
| Extends | Nothing |
| Since | v0.1.1 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
# Constants
This interface has not constants.
# Methods
Indicates whether the specified object is equal to the current instance.
public function equals( mixed $other ) : boolean
| Parameter | Type(s) | Description |
|---|---|---|
$other | mixed | Another object to compare equality. |
# NelsonMartell\IMagicPropertiesContainer
Mark a class that defines (some of) its properties as DocBlock by using @property, @property-read
or @property-write tags.
\NelsonMartell\PropertiesHandler trait will search for property definition in class DocBlock comment. They must be valid,
containing at least the type and name: @<property|property-read|property-write> <types> <name>.
Examples:
This will be detected:
// ...
// * @property-write string $name Some description
// * @property-read float $age Another description
// * @property int[]|float[] $items
This will not be detected:
// ...
// * @property int| string $invalidTypesSeparation
// * @property int|string $ invalid name
| Extends | Nothing |
| Since | v1.0.0 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
| See also | \NelsonMartell\PropertiesHandler |
# Constants
This interface has not constants.
# Methods
This interface has not methods.
# NelsonMartell\IStrictPropertiesContainer
Mark a class as implementing strict properties only.
All classes using PropertiesHandler trait should be marked with this interface.
| Extends | Nothing |
| Since | v0.6.0 |
| Authors | Nelson Martell <nelson6e65@gmail.com> |
| See also | \NelsonMartell\PropertiesHandler |
# Constants
This interface has not constants.
# Methods
Gets the value of specified property.
public function __get( string $name ) : mixed
| Parameter | Type(s) | Description |
|---|---|---|
$name | string | Property name. |
Returns:
Property value.
Sets the value of specified property.
public function __set( string $name, mixed $value ) : void
| Parameter | Type(s) | Description |
|---|---|---|
$name | string | Property name. |
$value | mixed | Property value. |
This document was automatically generated, from source code comments, using phpDocumentor (opens new window) with the VuePress template (opens new window).