Wallabag\CoreBundle\Entity\Entry::setTitle PHP Method

setTitle() public method

Set title.
public setTitle ( string $title ) : Entry
$title string
return Entry
    public function setTitle($title)
    {
        $this->title = $title;
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function parseEntry(array $importedEntry)
 {
     $existingEntry = $this->em->getRepository('WallabagCoreBundle:Entry')->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
     if (false !== $existingEntry) {
         ++$this->skippedEntries;
         return;
     }
     $data = $this->prepareEntry($importedEntry);
     $entry = new Entry($this->user);
     $entry->setUrl($data['url']);
     $entry->setTitle($data['title']);
     // update entry with content (in case fetching failed, the given entry will be return)
     $entry = $this->fetchContent($entry, $data['url'], $data);
     if (array_key_exists('tags', $data)) {
         $this->contentProxy->assignTagsToEntry($entry, $data['tags'], $this->em->getUnitOfWork()->getScheduledEntityInsertions());
     }
     if (isset($importedEntry['preview_picture'])) {
         $entry->setPreviewPicture($importedEntry['preview_picture']);
     }
     $entry->setArchived($data['is_archived']);
     $entry->setStarred($data['is_starred']);
     if (!empty($data['created_at'])) {
         $entry->setCreatedAt(new \DateTime($data['created_at']));
     }
     $this->em->persist($entry);
     ++$this->importedEntries;
     return $entry;
 }
All Usage Examples Of Wallabag\CoreBundle\Entity\Entry::setTitle