0
我在實體此定義:CakePHP的3.5 - 實體 - 虛擬現場沒有顯示
protected $_virtual = [ 'full_name' ];
protected function _getFullName()
{
return($this->_properties['firstname'] . ' ' . $this->_properties['lastname']);
}
但FULL_NAME領域不受任何查詢檢索(分頁程序或找到(「全部」))...當表被稱爲關聯表時。
主表是GenPersons。 在這種情況下,該字段顯示正確。 但隨後我讓
$this->paginate = [ 'contain' => ['GenPersons'] ]
從AerPilots控制器(AerPilots是一個模型);並試圖獲得該字段爲
$aerPilot->gen_person->full_name;
什麼都沒有顯示。
我忘了什麼嗎?