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

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

Set index
public setIndex ( Ojs\JournalBundle\Entity\Index $index ) : JournalIndex
$index Ojs\JournalBundle\Entity\Index
Результат JournalIndex
    public function setIndex(Index $index)
    {
        $this->index = $index;
        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::setIndex