Cake\Acl\Test\TestCase\Model\Behavior\AclPerson::parentNode PHP Method

parentNode() public method

parentNode method
public parentNode ( ) : void
return void
    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]];
    }
AclPerson