protected function parseForCommonValues($relation)
    {
        if (!$this->hasAttribute($relation)) {
            // If no attribute exists for this relationships
            // we'll make it a simple empty array. This will
            // save us from constantly checking for the attributes
            // actual existence.
            $this->relationships[$relation] = [];

            return false;
        }

        $value = $this->getRelationshipValue($relation);

        if (is_null($value)) {
            $this->relationships[$relation] = [];

            // If the relationship's content is the null value
            // and the Entity's exist in DB, we'll interpret this
            // as the need to detach all related Entities,
            // therefore a sync operation is needed.
            $this->needSync[] = $relation;

            return false;
        }

        return $value;
    }
protected function parseForCommonValues($relation)
    {
        if (!$this->hasAttribute($relation)) {
            // If no attribute exists for this relationships
            // we'll make it a simple empty array. This will
            // save us from constantly checking for the attributes
            // actual existence.
            $this->relationships[$relation] = [];

            return false;
        }

        $value = $this->getRelationshipValue($relation);

        if (is_null($value)) {
            $this->relationships[$relation] = [];

            // If the relationship's content is the null value
            // and the Entity's exist in DB, we'll interpret this
            // as the need to detach all related Entities,
            // therefore a sync operation is needed.
            $this->needSync[] = $relation;

            return false;
        }

        return $value;
    }
protected function parseForCommonValues ( $ relation ) { if ( ! $ this -> hasAttribute ( $ relation ) ) { // If no attribute exists for this relationships // we'll make it a simple empty array. This will // save us from constantly checking for the attributes // actual existence. $ this -> relationships [ $ relation ] = [ ] ; return false ; } $ value = $ this -> getRelationshipValue ( $ relation ) ; if ( is_null ( $ value ) ) { $ this -> relationships [ $ relation ] = [ ] ; // If the relationship's content is the null value // and the Entity's exist in DB, we'll interpret this // as the need to detach all related Entities, // therefore a sync operation is needed. $ this -> needSync [ ] = $ relation ; return false ; } return $ value ; }
Parse for values common to single & many relations.

@param string $relation

@throws MappingException

@return mixed|bool
Parse for values common to single & many relations .