Ojs\JournalBundle\Entity\JournalIndex::setJournal PHP Метод

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

Set journal
public setJournal ( Journal $journal = null ) : JournalIndex
$journal Journal
Результат JournalIndex
    public function setJournal(Journal $journal = null)
    {
        $this->journal = $journal;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * @return int
  */
 public function loadJournalIndex()
 {
     $journal = $this->em->getRepository(Journal::class)->find(1);
     $index = $this->em->getRepository(Index::class)->find(1);
     $entity = new JournalIndex();
     $entity->setIndex($index);
     $entity->setLink('http://ojs.io');
     $entity->setJournal($journal);
     $this->em->persist($entity);
     $this->em->flush();
     return $entity->getId();
 }
All Usage Examples Of Ojs\JournalBundle\Entity\JournalIndex::setJournal