public function setKey($key)
    {
        $this->key = $key;

        if (0 < strlen($this->key) && !$this->hasRename()) {
            if ($this->hasPath()) {
                $this->rename = pathinfo($this->path, PATHINFO_BASENAME);
            } else {
                $this->rename = pathinfo($this->key, PATHINFO_BASENAME);
            }
            $this->setUpdatedAt(new \DateTime());
        }

        return $this;
    }
public function setKey($key)
    {
        $this->key = $key;

        if (0 < strlen($this->key) && !$this->hasRename()) {
            if ($this->hasPath()) {
                $this->rename = pathinfo($this->path, PATHINFO_BASENAME);
            } else {
                $this->rename = pathinfo($this->key, PATHINFO_BASENAME);
            }
            $this->setUpdatedAt(new \DateTime());
        }

        return $this;
    }
public function setKey ( $ key ) { $ this -> key = $ key ; if ( 0 < strlen ( $ this -> key ) && ! $ this -> hasRename ( ) ) { if ( $ this -> hasPath ( ) ) { $ this -> rename = pathinfo ( $ this -> path , PATHINFO_BASENAME ) ; } else { $ this -> rename = pathinfo ( $ this -> key , PATHINFO_BASENAME ) ; } $ this -> setUpdatedAt ( new \ DateTime ( ) ) ; } return $ this ; }
Sets the key.

@param string $key
@return UploadableTrait
Sets the key .