Answer the question
In order to leave comments, you need to log in
Symfony sort form without creating table in db?
Comrades, is it possible to somehow create a form without creating a table in the database.
My Entity:
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @package AppBundle\Entity
* @ORM\Entity
*/
class FilterArea
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="date");
*/
protected $age;
/**
* @ORM\Column(type="boolean");
*/
protected $sex;
/**
* @ORM\ManyToOne(targetEntity="SocialNetwork", inversedBy="filter")
* @ORM\JoinColumn(name="rm_sn", referencedColumnName="id_sn", nullable=false)
*/
protected $social_network;
/**
* @ORM\ManyToOne(targetEntity="City", inversedBy="filter")
* @ORM\JoinColumn(name="rm_city", referencedColumnName="id_city", nullable=false)
*/
protected $citys;
/**
* Get idArea
*
* @return integer
*/
public function getIdArea()
{
return $this->id_area;
}
/**
* Set age
*
* @param \DateTime $age
*
* @return FilterArea
*/
public function setAge($age)
{
$this->age = $age;
return $this;
}
/**
* Get age
*
* @return \DateTime
*/
public function getAge()
{
return $this->age;
}
/**
* Set sex
*
* @param boolean $sex
*
* @return FilterArea
*/
public function setSex($sex)
{
$this->sex = $sex;
return $this;
}
/**
* Get sex
*
* @return boolean
*/
public function getSex()
{
return $this->sex;
}
/**
* Set socialNetwork
*
* @param \AppBundle\Entity\SocialNetwork $socialNetwork
*
* @return FilterArea
*/
public function setSocialNetwork(\AppBundle\Entity\SocialNetwork $socialNetwork)
{
$this->social_network = $socialNetwork;
return $this;
}
/**
* Get socialNetwork
*
* @return \AppBundle\Entity\SocialNetwork
*/
public function getSocialNetwork()
{
return $this->social_network;
}
/**
* Set citys
*
* @param \AppBundle\Entity\City $citys
*
* @return FilterArea
*/
public function setCitys(\AppBundle\Entity\City $citys)
{
$this->citys = $citys;
return $this;
}
/**
* Get citys
*
* @return \AppBundle\Entity\City
*/
public function getCitys()
{
return $this->citys;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question