Newscoop\Entity\Attachment::setDescription PHP Метод

setDescription() публичный Метод

Sets the value of description.
public setDescription ( Translation $description ) : self
$description Translation the description
Результат self
    public function setDescription(\Newscoop\Entity\Translation $description)
    {
        $this->description = $description;
        return $this;
    }

Usage Example

 public function it_should_update_attachment()
 {
     $filesystem = new Filesystem();
     $newFileName = __DIR__ . '/../../assets/images/temp-image.jpg';
     $filesystem->copy(__DIR__ . '/../../assets/images/picture.jpg', $newFileName);
     $uploadedFile = new UploadedFile($newFileName, 'temp-image.jpg', 'image/jpg', filesize($newFileName), null, true);
     $language = new Language();
     $attachment = new Attachment();
     $phraseId = 1;
     $description = new Translation($phraseId);
     $description->setLanguage($language);
     $description->setTranslationText('Description text');
     $attachment->setDescription($description);
     $this->upload($uploadedFile, 'Test file - updated', $language, array(), $attachment);
 }
All Usage Examples Of Newscoop\Entity\Attachment::setDescription