DbServiceModel
extends DbServiceModelBase
in package
Default DB model for the service
Tags
Table of Contents
- $entityName : string
- Entity name
- $fieldsSet : FieldsSet
- Fields algorithms
- $tableName : string
- Table name
- __construct() : mixed
- Constructor
- getApropriateConnection() : PdoCrud
- Method returns appropriate connections
- getEntityName() : string
- Method returns entity name
- getFields() : array<string|int, string>
- Method returns fields list
- getFieldsNames() : string
- Method returns list of all fields as string
- getFieldType() : string
- Method returns field type
- getTableName() : string
- Method returns table name
- hasCustomFields() : bool
- Method returns true if the custom field exists
- hasField() : bool
- Method returns true if the field exists
- validateFieldExistance() : void
- Method validates if the field $field exists
- setTableName() : void
- Method sets table name
Properties
$entityName
Entity name
private
string
$entityName
= ''
$fieldsSet
Fields algorithms
private
FieldsSet
$fieldsSet
$tableName
Table name
private
string
$tableName
= ''
Methods
__construct()
Constructor
public
__construct([mixed $fields = '*' ][, string $tableName = '' ][, string $entityName = '' ]) : mixed
Parameters
- $fields : mixed = '*'
- $tableName : string = ''
-
name of the table
- $entityName : string = ''
-
name of the entity
Tags
Return values
mixed —getApropriateConnection()
Method returns appropriate connections
public
static getApropriateConnection() : PdoCrud
Return values
PdoCrud —connection
getEntityName()
Method returns entity name
public
getEntityName() : string
Return values
string —entity name
getFields()
Method returns fields list
public
getFields() : array<string|int, string>
Return values
array<string|int, string> —fields list
getFieldsNames()
Method returns list of all fields as string
public
getFieldsNames() : string
Return values
string —list of all fields as string
getFieldType()
Method returns field type
public
getFieldType(string $fieldName) : string
Parameters
- $fieldName : string
-
field name
Return values
string —field type
getTableName()
Method returns table name
public
getTableName() : string
Return values
string —table name
hasCustomFields()
Method returns true if the custom field exists
public
hasCustomFields() : bool
Return values
bool —hasField()
Method returns true if the field exists
public
hasField(string $fieldName) : bool
Parameters
- $fieldName : string
-
field name
Return values
bool —validateFieldExistance()
Method validates if the field $field exists
public
validateFieldExistance(string $field) : void
Parameters
- $field : string
-
Field name
Return values
void —setTableName()
Method sets table name
protected
setTableName([string $tableName = '' ]) : void
Parameters
- $tableName : string = ''
-
table name