public function extension($extension = null)
    {
        if (is_null($extension)) {
            if (!empty($this->extension)) {
                return $this->extension;
            }
            if (isset($this->attributes['extension'])) {
                return $this->attributes['extension'];
            }
        }
        $this->extension = $this->checkExtension($extension);

        return $this;
    }
public function extension($extension = null)
    {
        if (is_null($extension)) {
            if (!empty($this->extension)) {
                return $this->extension;
            }
            if (isset($this->attributes['extension'])) {
                return $this->attributes['extension'];
            }
        }
        $this->extension = $this->checkExtension($extension);

        return $this;
    }
public function extension ( $ extension = null ) { if ( is_null ( $ extension ) ) { if ( ! empty ( $ this -> extension ) ) { return $ this -> extension ; } if ( isset ( $ this -> attributes [ 'extension' ] ) ) { return $ this -> attributes [ 'extension' ] ; } } $ this -> extension = $ this -> checkExtension ( $ extension ) ; return $ this ; }
Set or get extension.

@param string $extension File extension

@return string|this File extension
Set or get extension .