* `Since Eloquent models are query builders, you should review all of the methods available on the query builder. You may use any of these methods in your Eloquent queries.`
* type: Name of the Doctrine Type which is converted between PHP and Database representation.
* name: By default the property name is used for the database column name also, however the ‘name’ attribute allows you to determine the column name.
* length: Used by the “string” type to determine its maximum length in the database. Doctrine does not validate the length of a string values for you.
* precision: The precision for a decimal (exact numeric) column (applies only for decimal column), which is the maximum number of digits that are stored for the values.
* scale: The scale for a decimal (exact numeric) column (applies only for decimal column), which represents the number of digits to the right of the decimal point and must not be greater than precision.
* unique: Boolean value to determine if the value of the column should be unique across all rows of the underlying entities table.
* nullable: Determines if NULL values allowed for this column. If not specified, default value is false.
* options: Array of additional options:
* default: The default value to set for the column if no value is supplied.
* unsigned: Boolean value to determine if the column should be capable of representing only non-negative integers (applies only for integer column and might not be supported by all vendors).
* fixed: Boolean value to determine if the specified length of a string column should be fixed or varying (applies only for string/binary column and might not be supported by all vendors).
* comment: The comment of the column in the schema (might not be supported by all vendors).
* collation: The collation of the column (only supported by Drizzle, Mysql, PostgreSQL>=9.1, Sqlite and SQLServer).
* check: Adds a check constraint type to the column (might not be supported by all vendors).
* columnDefinition: DDL SQL snippet that starts after the column name and specifies the complete (non-portable!) column definition. This attribute allows to make use of advanced RMDBS features. However you should make careful use of this feature and the consequences. SchemaTool will not detect changes on the column correctly anymore if you use “columnDefinition”.
* Additionally you should remember that the “type” attribute still handles the conversion between PHP and Database values. If you use this attribute on a column that is used for joins between tables you should also take a look at @JoinColumn.
*
*
* derivedFrom: AKA dynamic field!
*
*
*
*/
abstract class EntityMap
{
protected $fields;
protected $from;
protected $tables;
protected $joins; // optional
protected $properties;
protected $aliases;
protected $relationships;
protected $indexes;
protected $constraints; // AKA validations?
// abstract private __get__();
function __construct(array $properties = null)
/**
* The current globally available instance (if any).
*
* @var static
*/
protected static $instance = null;
protected function __construct()
{
}
/**
* Get the globally available instance
*
* @return static
*/
public static function getInstance()
{
$this->properties =& $properties;
if ( ! isset(static::$instance))
{
static::$instance = new static();
}
return static::$instance;
}
}
/*
'aliases' => [ 'w' => 'worlds',
@ -64,7 +120,7 @@ abstract class EntityMap
@@ -64,7 +120,7 @@ abstract class EntityMap
''
];
public $virtualFields = [ 'age' => 'TIMESTAMPDIFF(YEAR, u.dob, NOW()) as age',
public $virtualFields = [ 'age' => 'TIMESTAMPDIFF(YEAR, u.dob, NOW()) as age', // AKA derived fields