src/Traits/Collection/ElementContainer.php
public function setId($id)
    {
        $id = $this->buildId($id);

        if ($this->isRelation($id)) {
            $relations = explode('.', $id);

            $lastElement = array_pop($relations);

            if (!$this->keepOriginalID) {
                $id = $lastElement;
            }

            $this->relations = $relations;
        }

        $this->id = $id;

        return $this;
    }
public function setId($id)
    {
        $id = $this->buildId($id);

        if ($this->isRelation($id)) {
            $relations = explode('.', $id);

            $lastElement = array_pop($relations);

            if (!$this->keepOriginalID) {
                $id = $lastElement;
            }

            $this->relations = $relations;
        }

        $this->id = $id;

        return $this;
    }
public function setId ( $ id ) { $ id = $ this -> buildId ( $ id ) ; if ( $ this -> isRelation ( $ id ) ) { $ relations = explode ( '.' , $ id ) ; $ lastElement = array_pop ( $ relations ) ; if ( ! $ this -> keepOriginalID ) { $ id = $ lastElement ; } $ this -> relations = $ relations ; } $ this -> id = $ id ; return $ this ; }
Set element ID.

@param $id

@return $this
Set element ID .