I am using cakephp 3.1
Suppose I have this simple controller action below.
public function apiGetAccessKey($username)
{
$query = $this->Customers
->find()
->select('access_key')
->where(['username' => $username]);
}
I want to transfer it into the Model since it involves data extraction. With cakephp 3.x, model is divided into Table and Entity. Which should I use? Table or Entity? How should the code look like?