for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class Category extends AppModel {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
public $belongsTo = array(
'ParentCategory' => array(
'className' => 'Category',
'foreignKey' => 'parent_id',
),
);
public $hasAndBelongsToMany = array('Article');
/**
* {@inheritDoc}
*/
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
$this->virtualFields['is_root'] = "CASE WHEN {$this->alias}.parent_id = 0 THEN 1 ELSE 0 END";
}
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.