Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // src/Dessin/PlanBundle/Entity/Frame.php
- namespace Dessin\PlanBundle\Entity;
- use Doctrine\DBAL\Types\StringType;
- use Doctrine\DBAL\Types\IntegerType;
- use Doctrine\DBAL\Types\BooleanType;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- //use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * @ORM\Entity
- * @ORM\Table(name="Frame")
- */
- class Frame
- {
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- *
- * @var integer $id
- */
- protected $id;
- /**
- * @ORM\Column(type="integer")
- *
- * @var integer type
- */
- protected $type;
- /**
- * @ORM\Column(type="boolean")
- *
- * @var boolean margin
- */
- protected $margin;
- /**
- * @ORM\Column(type="float", nullable=true)
- *
- * @var float marginH
- */
- protected $marginH;
- /**
- * @ORM\Column(type="float", nullable=true)
- *
- * @var float marginV
- */
- protected $marginV;
- /**
- * @ORM\Column(type="boolean")
- *
- * @var boolean title
- */
- protected $title;
- /**
- * @ORM\Column(type="string", nullable=true)
- *
- * @var string locality
- */
- protected $locality;
- /**
- * @ORM\Column(type="boolean")
- *
- * @var boolean cartridge
- */
- protected $cartridge;
- /**
- * @ORM\Column(type="float", nullable=true)
- *
- * @var string cartridgeV
- */
- protected $cartridgeV;
- /**
- * @ORM\Column(type="float", nullable=true)
- *
- * @var string cartridgeH
- */
- protected $cartridgeH;
- /*
- /**
- * @ORM\OneToOne(targetEntity="Notice")
- */
- /*protected $notice;*/
- //* @ORM\ManyToOne(targetEntity="Notice", inversedBy="frames", cascade={"persist"})
- /**
- * @ORM\ManyToOne(targetEntity="Notice", inversedBy="frames")
- * @ORM\JoinColumn(name="notice_id", referencedColumnName="id", nullable=true)
- *
- */
- protected $notice;
- /**
- * @ORM\Column(type="boolean")
- *
- * @var boolean foldMark
- */
- protected $foldMark;
- /**
- * @ORM\Column(type="boolean")
- *
- * @var boolean scale
- */
- protected $scale;
- /**
- * @ORM\Column(type="float", nullable=true)
- *
- * @var float scaleLength
- */
- protected $scaleLength;
- /**
- * @ORM\Column(type="integer", nullable=true)
- *
- * @var integer scaleSubdivisions
- */
- protected $scaleSubdivisions;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set type
- *
- * @param integer $type
- */
- public function setType($type)
- {
- $this->type = $type;
- }
- /**
- * Get type
- *
- * @return integer
- */
- public function getType()
- {
- return $this->type;
- }
- /**
- * Set margin
- *
- * @param boolean $margin
- */
- public function setMargin($margin)
- {
- $this->margin = $margin;
- }
- /**
- * Get margin
- *
- * @return boolean
- */
- public function getMargin()
- {
- return $this->margin;
- }
- /**
- * Set marginH
- *
- * @param float $marginH
- */
- public function setMarginH($marginH)
- {
- $this->marginH = $marginH;
- }
- /**
- * Get marginH
- *
- * @return float
- */
- public function getMarginH()
- {
- return $this->marginH;
- }
- /**
- * Set marginV
- *
- * @param float $marginV
- */
- public function setMarginV($marginV)
- {
- $this->marginV = $marginV;
- }
- /**
- * Get marginV
- *
- * @return float
- */
- public function getMarginV()
- {
- return $this->marginV;
- }
- /**
- * Set title
- *
- * @param boolean $title
- */
- public function setTitle($title)
- {
- $this->title = $title;
- }
- /**
- * Get title
- *
- * @return boolean
- */
- public function getTitle()
- {
- return $this->title;
- }
- /**
- * Set locality
- *
- * @param string $locality
- */
- public function setLocality($locality)
- {
- $this->locality = $locality;
- }
- /**
- * Get locality
- *
- * @return string
- */
- public function getLocality()
- {
- return $this->locality;
- }
- /**
- * Set cartridge
- *
- * @param boolean $cartridge
- */
- public function setCartridge($cartridge)
- {
- $this->cartridge = $cartridge;
- }
- /**
- * Get cartridge
- *
- * @return boolean
- */
- public function getCartridge()
- {
- return $this->cartridge;
- }
- /**
- * Set cartridgeV
- *
- * @param float $cartridgeV
- */
- public function setCartridgeV($cartridgeV)
- {
- $this->cartridgeV = $cartridgeV;
- }
- /**
- * Get cartridgeV
- *
- * @return float
- */
- public function getCartridgeV()
- {
- return $this->cartridgeV;
- }
- /**
- * Set cartridgeH
- *
- * @param float $cartridgeH
- */
- public function setCartridgeH($cartridgeH)
- {
- $this->cartridgeH = $cartridgeH;
- }
- /**
- * Get cartridgeH
- *
- * @return float
- */
- public function getCartridgeH()
- {
- return $this->cartridgeH;
- }
- /**
- * Set foldMark
- *
- * @param boolean $foldMark
- */
- public function setFoldMark($foldMark)
- {
- $this->foldMark = $foldMark;
- }
- /**
- * Get foldMark
- *
- * @return boolean
- */
- public function getFoldMark()
- {
- return $this->foldMark;
- }
- /**
- * Set scale
- *
- * @param boolean $scale
- */
- public function setScale($scale)
- {
- $this->scale = $scale;
- }
- /**
- * Get scale
- *
- * @return boolean
- */
- public function getScale()
- {
- return $this->scale;
- }
- /**
- * Set scaleLength
- *
- * @param float $scaleLength
- */
- public function setScaleLength($scaleLength)
- {
- $this->scaleLength = $scaleLength;
- }
- /**
- * Get scaleLength
- *
- * @return float
- */
- public function getScaleLength()
- {
- return $this->scaleLength;
- }
- /**
- * Set scaleSubdivisions
- *
- * @param integer $scaleSubdivisions
- */
- public function setScaleSubdivisions($scaleSubdivisions)
- {
- $this->scaleSubdivisions = $scaleSubdivisions;
- }
- /**
- * Get scaleSubdivisions
- *
- * @return integer
- */
- public function getScaleSubdivisions()
- {
- return $this->scaleSubdivisions;
- }
- /**
- * Set notice
- *
- * @param Dessin\PlanBundle\Entity\Notice $notice
- */
- public function setNotice(\Dessin\PlanBundle\Entity\Notice $notice = NULL)
- {
- $this->notice = $notice;
- }
- /**
- * Get notice
- *
- * @return Dessin\PlanBundle\Entity\Notice
- */
- public function getNotice()
- {
- return $this->notice;
- }
- public function __construct(){
- $this->title = false;
- $this->cartridge = false;
- $this->foldMark = false;
- $this->scale = false;
- }
- /**
- * force margin properties when margin checkbox is ticked
- *
- * @Assert\True(message = "margin.is.enabled.but.margin.properties.are.not.filled.")
- */
- public function isMarginFilledProperly()
- {
- return ( !$this->margin || ( $this->margin && isset($this->marginH) && isset($this->marginV) ) );
- }
- /**
- * force cartridge properties when cartridge checkbox is ticked
- *
- * @Assert\True(message = "cartridge.is.enabled.but.its.properties.are.not.filled.")
- */
- public function isCartridgeFilledProperly()
- {
- return ( !$this->cartridge || ( $this->cartridge && isset($this->cartridgeH) && isset($this->cartridgeV) ) );
- }
- /**
- * force scale properties when scale checkbox is ticked
- *
- * @Assert\True(message = "scale.is.enabled.but.its.properties.are.not.filled.")
- */
- public function isScaleFilledProperly()
- {
- return ( !$this->scale || ( $this->scale && isset($this->scaleLength) && isset($this->scaleSubdivisions) ) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment