public function addCover(AnCommandContext $context)
    {
        $entity = $this->getItem();
        
        if ($entity->isCoverable() && AnRequest::has('files.cover')) {
            $file = AnRequest::get('files.cover', 'raw');

            if ($this->_mixer->bellowSizeLimit($file) && $file['error'] == 0) {
                $entity->setCover(array('url' => $file['tmp_name'], 'mimetype' => $file['type']));
            }
        }

        return $entity;
    }
public function addCover(AnCommandContext $context)
    {
        $entity = $this->getItem();
        
        if ($entity->isCoverable() && AnRequest::has('files.cover')) {
            $file = AnRequest::get('files.cover', 'raw');

            if ($this->_mixer->bellowSizeLimit($file) && $file['error'] == 0) {
                $entity->setCover(array('url' => $file['tmp_name'], 'mimetype' => $file['type']));
            }
        }

        return $entity;
    }
public function addCover ( AnCommandContext $ context ) { $ entity = $ this -> getItem ( ) ; if ( $ entity -> isCoverable ( ) && AnRequest :: has ( 'files.cover' ) ) { $ file = AnRequest :: get ( 'files.cover' , 'raw' ) ; if ( $ this -> _mixer -> bellowSizeLimit ( $ file ) && $ file [ 'error' ] == 0 ) { $ entity -> setCover ( array ( 'url' => $ file [ 'tmp_name' ] , 'mimetype' => $ file [ 'type' ] ) ) ; } } return $ entity ; }
Add a cover.

@param AnCommandContext $context Context parameter

@return AnDomainEntityAbstract
Add a cover .