- Things to know before using ORM
- How field attributes work
- Set property type
- Set table field type
- Set table field length
- Set table field default value
- Define property field as primary field
- Set relation
- Set enumeration
- Implement custom value type
- Map property to custom field name
- Set null
- Set unsigned
- Set zerofill
- Set date on insert on update
What is php doc comments?
It is official code documentation form supported by native PHP API. With php doc comments you can document your classes, properties and methods and other things not related to classes. For example:
/** * @var \user\group */ public $group;
PHP fetches this comment section (which begins with
/** line and ends with line
public $group property documentation. This documentation can be accessed later using php reflection class. There are couple of standard keywords which can be used inside this doc comments. These keywords are used by various php IDEs and by other projects like phpdoc.
@var \user\group tells that following property is type of class located in namespace user and called group (\user\group). Unlike regular comments in PHP, php doc comments first line must begin with:
Must be followed with next lines containing special keywords. These lines must begin with:
And php doc comments section must be closed like regular comments section:
Spaces tabs and other things does not matter. Indeed only matters php doc comments comment opening.
db.php uses php doc comments to extract additional informations about properties and classes.
Get more info at http://php.net/manual/en/reflectionclass.getdoccomment.php