<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Network
*
* @ORM\Table(name="network")
* @ORM\Entity(repositoryClass="App\Repository\NetworkRepository")
*/
class Network
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity="Line", mappedBy="network")
*/
private $lines;
public function __toString()
{
return $this->name;
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
*
* @return Network
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Constructor
*/
public function __construct()
{
$this->lines = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add line
*
* @param \App\Entity\Line $line
*
* @return Network
*/
public function addLine(\App\Entity\Line $line)
{
$this->lines[] = $line;
return $this;
}
/**
* Remove line
*
* @param \App\Entity\Line $line
*/
public function removeLine(\App\Entity\Line $line)
{
$this->lines->removeElement($line);
}
/**
* Get lines
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getLines()
{
return $this->lines;
}
}