public function getByProperty($prop)
    {
        foreach ($this->_items as $assoc) {
            if ($assoc->getProperty() === $prop) {
                return $assoc;
            }
        }

        return null;
    }
public function getByProperty($prop)
    {
        foreach ($this->_items as $assoc) {
            if ($assoc->getProperty() === $prop) {
                return $assoc;
            }
        }

        return null;
    }
public function getByProperty ( $ prop ) { foreach ( $ this -> _items as $ assoc ) { if ( $ assoc -> getProperty ( ) === $ prop ) { return $ assoc ; } } return null ; }
Fetch an association by property name.

@param string $prop The property to find an association by.
@return \Cake\ORM\Association|null Either the association or null.
Fetch an association by property name .