CakePHP

Database naming conventions

  • Table name: projects, project_statuses, customers, addresses
    • If not sure, try Inflector::pluralize('project_status')
  • Primary key: id
  • Foreign keys: customer_id, project_status_id
    • Self reference: parent_id
  • Display field: Call it name, to automatically use it when baking
  • Timestamp: The fields created and modified will be automatically updated

Add a record with a field filled in from request parameters

In the Controllers function add()

if ($this->request->is('post')) {
    // [...]
} else { // add this
    $entityName->fieldName = $this->request->getQuery("fieldName");
}