protected function _getSingleEntity($subject)
    {
        if (!empty($subject->entities)) {
            return $subject->entities->first();
        }

        return $subject->entity;
    }
protected function _getSingleEntity($subject)
    {
        if (!empty($subject->entities)) {
            return $subject->entities->first();
        }

        return $subject->entity;
    }
protected function _getSingleEntity ( $ subject ) { if ( ! empty ( $ subject -> entities ) ) { return $ subject -> entities -> first ( ) ; } return $ subject -> entity ; }
Helper function to easily retrieve a single entity from Crud subject
find result regardless of current action.

@param \Crud\Event\Subject $subject Subject
@return \Cake\ORM\Entity
Helper function to easily retrieve a single entity from Crud subject find result regardless of current action .