public function findByIdentifier(FamilyInterface $family, $reference, $idFallback = false, $partialLoad = false)
    {
        $identifierAttribute = $family->getAttributeAsIdentifier();
        if (!$identifierAttribute) {
            if (!$idFallback) {
                $m = "Cannot find data with no identifier attribute for family: '{$family->getCode()}'";
                throw new \UnexpectedValueException($m);
            }

            return $this->findByPrimaryKey($family, $reference, $partialLoad);
        }

        return $this->findByUniqueAttribute($family, $identifierAttribute, $reference, $partialLoad);
    }
public function findByIdentifier(FamilyInterface $family, $reference, $idFallback = false, $partialLoad = false)
    {
        $identifierAttribute = $family->getAttributeAsIdentifier();
        if (!$identifierAttribute) {
            if (!$idFallback) {
                $m = "Cannot find data with no identifier attribute for family: '{$family->getCode()}'";
                throw new \UnexpectedValueException($m);
            }

            return $this->findByPrimaryKey($family, $reference, $partialLoad);
        }

        return $this->findByUniqueAttribute($family, $identifierAttribute, $reference, $partialLoad);
    }
public function findByIdentifier ( FamilyInterface $ family , $ reference , $ idFallback = false , $ partialLoad = false ) { $ identifierAttribute = $ family -> getAttributeAsIdentifier ( ) ; if ( ! $ identifierAttribute ) { if ( ! $ idFallback ) { $ m = "Cannot find data with no identifier attribute for family: '{$family->getCode()}'" ; throw new \ UnexpectedValueException ( $ m ) ; } return $ this -> findByPrimaryKey ( $ family , $ reference , $ partialLoad ) ; } return $ this -> findByUniqueAttribute ( $ family , $ identifierAttribute , $ reference , $ partialLoad ) ; }
Find data based on it's family identifier

@param FamilyInterface $family
@param int|string      $reference
@param bool            $idFallback
@param bool            $partialLoad

@throws NonUniqueResultException
@throws \UnexpectedValueException
@throws ORMException
@throws \LogicException

@return DataInterface|null
Find data based on it s family identifier