public function parentNode()
{
if (!$this->id) {
return null;
}
if (isset($this->mother_id)) {
$motherId = $this->mother_id;
} else {
$People = TableRegistry::get('AclPeople');
$person = $People->find('all', ['fields' => ['mother_id']])->where(['id' => $this->id])->first();
$motherId = $person->mother_id;
}
if (!$motherId) {
return null;
}
return ['AclPeople' => ['id' => $motherId]];
}