protected function assignRelationships($entity, $attributes)
    {
        $modelAttributes = $this->model->getAttributes($entity);

        // We'll filter through all of the columns, and check
        // to see if there are any defined relationships. If there
        // are, then we'll need to create those records as well.

        foreach ($modelAttributes as $columnName => $value) {
            if ($relationship = $this->findRelation($value)) {
                $entity[$columnName] = $this->fetchRelationId($relationship, $columnName, $attributes);
            }
        }

        return $entity;
    }
protected function assignRelationships($entity, $attributes)
    {
        $modelAttributes = $this->model->getAttributes($entity);

        // We'll filter through all of the columns, and check
        // to see if there are any defined relationships. If there
        // are, then we'll need to create those records as well.

        foreach ($modelAttributes as $columnName => $value) {
            if ($relationship = $this->findRelation($value)) {
                $entity[$columnName] = $this->fetchRelationId($relationship, $columnName, $attributes);
            }
        }

        return $entity;
    }
protected function assignRelationships ( $ entity , $ attributes ) { $ modelAttributes = $ this -> model -> getAttributes ( $ entity ) ; // We'll filter through all of the columns, and check // to see if there are any defined relationships. If there // are, then we'll need to create those records as well. foreach ( $ modelAttributes as $ columnName => $ value ) { if ( $ relationship = $ this -> findRelation ( $ value ) ) { $ entity [ $ columnName ] = $ this -> fetchRelationId ( $ relationship , $ columnName , $ attributes ) ; } } return $ entity ; }
Prepare and assign any applicable relationships.

@param  mixed $entity
@param  array $attributes
@return mixed
Prepare and assign any applicable relationships .