As the name says, it is made to be basic and direct.
Model class
Basicis\Model\ModelInterface, Stringable
Name | Description |
---|---|
__construct | Function function |
__toArray | Function __toArray |
Get Entity Data as Array, without the propreties defined in the array property $protecteds | |
__toString | Function __toString |
Get Entity Data as Json, without the propreties defined in the array property $protecteds | |
all | Function all |
Find all entities | |
allToArray | Function all |
Find all entities, and return a array or null | |
delete | Function delete |
Remove data of this entity of database | |
exists | Function exists |
Check if a entity by any column match | |
find | Function find |
Find a entity by id | |
findBy | Function findBy |
Find all entities by any column match | |
findOneBy | Function findOneBy |
Find a entity by any column match | |
getCreated | Function getCreated |
Return entity created timestamp | |
getId | Function getId |
Return entity ID (unique on system identification) | |
getManager | Function getManager |
Get a instance of Doctrine ORM EntityManager an return this, or null | |
getPropertyAnnotation | Function getPropertyAnnotation |
Get a array with property annotations data by prop and tag names, default tag Column |
|
getProtecteds | Function getProtecteds |
Get protecteds properties | |
getTableName | Function getTableName |
Get entity table name | |
getUpdated | Function getUpdated |
Return entity updated timestamp | |
paginate | Function paginate |
Paginate entity search with start offset (0) and total, this is ten (10) by default | |
query | Function query |
Execute a sql query string | |
removeProtecteds | Function removeProtecteds |
Get Entity Data as Array, without the propreties defined in the array property $protecteds | |
save | Function save |
Save data of this entity to database, use for create or update entities | |
setCreated | Function setCreated |
Set entity creation timestamp | |
setUpdated | Function setUpdated |
Set entity updated timestamp |
Description
public __construct (array|int|null $data)
Function function
Parameters
(array|int|null) $data
Return Values
void
Description
public __toArray (void)
Function __toArray Get Entity Data as Array, without the propreties defined in the array property $protecteds
Parameters
This function has no parameters.
Return Values
array
Description
public __toString (void)
Function __toString Get Entity Data as Json, without the propreties defined in the array property $protecteds
Parameters
This function has no parameters.
Return Values
string
Description
public static all (void)
Function all Find all entities
Parameters
This function has no parameters.
Return Values
array
Description
public static allToArray (void)
Function all Find all entities, and return a array or null
Parameters
This function has no parameters.
Return Values
array|null
Description
public delete (void)
Function delete Remove data of this entity of database
Parameters
This function has no parameters.
Return Values
bool
Description
public static exists (array $findBy)
Function exists Check if a entity by any column match
Parameters
(array) $findBy
Return Values
bool
Description
public static find (array $id)
Function find Find a entity by id
Parameters
(array) $id
Return Values
\Model|null
Description
public static findBy (array $findBy)
Function findBy Find all entities by any column match
Parameters
(array) $findBy
Return Values
array|\Model[]|null
Description
public static findOneBy (array $findOneBy)
Function findOneBy Find a entity by any column match
Parameters
(array) $findOneBy
Return Values
\Model|null
Description
public getCreated (void)
Function getCreated Return entity created timestamp
Parameters
This function has no parameters.
Return Values
\DateTime
Description
public getId (void)
Function getId Return entity ID (unique on system identification)
Parameters
This function has no parameters.
Return Values
int|null
Description
public static getManager (string $class)
Function getManager Get a instance of Doctrine ORM EntityManager an return this, or null
Parameters
(string) $class
Return Values
\EntityManager|null
Description
public static getPropertyAnnotation (string $name, string $tag)
Function getPropertyAnnotation
Get a array with property annotations data by prop and tag names, default tag Column
Parameters
(string) $name
(string) $tag
Return Values
array|null
Description
public getProtecteds (void)
Function getProtecteds Get protecteds properties
Parameters
This function has no parameters.
Return Values
array
Description
public static getTableName (void)
Function getTableName Get entity table name
Parameters
This function has no parameters.
Return Values
string
Description
public getUpdated (void)
Function getUpdated Return entity updated timestamp
Parameters
This function has no parameters.
Return Values
\DateTime
Description
public static paginate (int $limit, int $offset, array $protecteds)
Function paginate Paginate entity search with start offset (0) and total, this is ten (10) by default
Parameters
(int) $limit
(int) $offset
(array) $protecteds
Return Values
array
Description
public static query (string $sql, array $protecteds)
Function query Execute a sql query string
Parameters
(string) $sql
(array) $protecteds
Return Values
array|null
Description
public static removeProtecteds (void)
Function removeProtecteds Get Entity Data as Array, without the propreties defined in the array property $protecteds
Parameters
This function has no parameters.
Return Values
array
Description
public save (void)
Function save Save data of this entity to database, use for create or update entities
Parameters
This function has no parameters.
Return Values
\Model
Description
public setCreated (string $created)
Function setCreated Set entity creation timestamp
Parameters
(string) $created
Return Values
\Model
Description
public setUpdated (string $updated)
Function setUpdated Set entity updated timestamp
Parameters
(string) $updated
Return Values
\User