Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppBundleEntity;
- use DoctrineORMMapping as ORM;
- /**
- * newspaper_name
- *
- * @ORMTable(name="newspaper_name")
- * @ORMEntity(repositoryClass="AppBundleRepositorynewspaper_nameRepository")
- */
- class newspaper_name
- {
- /**
- * @var int
- *
- * @ORMColumn(name="id", type="integer")
- * @ORMId
- * @ORMGeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- *
- * @ORMColumn(name="name", type="string", length=255)
- */
- private $name;
- /**
- * One newspaper has One design.
- * @ORMOneToOne(targetEntity="newspaper_design", mappedBy="newspapername")
- */
- private $newspaperdesign;
- /**
- * One newspaper has One font.
- * @ORMOneToOne(targetEntity="newspaper_fonts", mappedBy="newspapername")
- */
- private $newspaperfonts;
- /**
- * One newspaper has Many releases.
- * @ORMOneToMany(targetEntity="newspaper_releases", mappedBy="newspapername")
- */
- private $newspaperreleases;
- /**
- * One newspaper has Many categories.
- * @ORMOneToMany(targetEntity="newspaper_categories", mappedBy="newspapername")
- */
- private $newspapercategories;
- /**
- * @var string
- *
- * @ORMColumn(name="description", type="text")
- */
- private $description;
- /**
- * Get id
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set name
- *
- * @param string $name
- *
- * @return newspapername
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Get name
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Set description
- *
- * @param string $description
- *
- * @return newspapername
- */
- public function setDescription($description)
- {
- $this->description = $description;
- return $this;
- }
- /**
- * Get description
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->description;
- }
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->newspaperreleases = new DoctrineCommonCollectionsArrayCollection();
- $this->newspapercategories = new DoctrineCommonCollectionsArrayCollection();
- }
- /**
- * Set newspaperdesign
- *
- * @param AppBundleEntitynewspaper_design $newspaperdesign
- *
- * @return newspaper_name
- */
- public function setNewspaperdesign(AppBundleEntitynewspaper_design $newspaperdesign = null)
- {
- $this->newspaperdesign = $newspaperdesign;
- return $this;
- }
- /**
- * Get newspaperdesign
- *
- * @return AppBundleEntitynewspaper_design
- */
- public function getNewspaperdesign()
- {
- return $this->newspaperdesign;
- }
- /**
- * Set newspaperfonts
- *
- * @param AppBundleEntitynewspaper_fonts $newspaperfonts
- *
- * @return newspaper_name
- */
- public function setNewspaperfonts(AppBundleEntitynewspaper_fonts $newspaperfonts = null)
- {
- $this->newspaperfonts = $newspaperfonts;
- return $this;
- }
- /**
- * Get newspaperfonts
- *
- * @return AppBundleEntitynewspaper_fonts
- */
- public function getNewspaperfonts()
- {
- return $this->newspaperfonts;
- }
- /**
- * Add newspaperrelease
- *
- * @param AppBundleEntitynewspaper_releases $newspaperrelease
- *
- * @return newspaper_name
- */
- public function addNewspaperrelease(AppBundleEntitynewspaper_releases $newspaperrelease)
- {
- $this->newspaperreleases[] = $newspaperrelease;
- return $this;
- }
- /**
- * Remove newspaperrelease
- *
- * @param AppBundleEntitynewspaper_releases $newspaperrelease
- */
- public function removeNewspaperrelease(AppBundleEntitynewspaper_releases $newspaperrelease)
- {
- $this->newspaperreleases->removeElement($newspaperrelease);
- }
- /**
- * Get newspaperreleases
- *
- * @return DoctrineCommonCollectionsCollection
- */
- public function getNewspaperreleases()
- {
- return $this->newspaperreleases;
- }
- /**
- * Add newspapercategory
- *
- * @param AppBundleEntitynewspaper_categories $newspapercategory
- *
- * @return newspaper_name
- */
- public function addNewspapercategory(AppBundleEntitynewspaper_categories $newspapercategory)
- {
- $this->newspapercategories[] = $newspapercategory;
- return $this;
- }
- /**
- * Remove newspapercategory
- *
- * @param AppBundleEntitynewspaper_categories $newspapercategory
- */
- public function removeNewspapercategory(AppBundleEntitynewspaper_categories $newspapercategory)
- {
- $this->newspapercategories->removeElement($newspapercategory);
- }
- /**
- * Get newspapercategories
- *
- * @return DoctrineCommonCollectionsCollection
- */
- public function getNewspapercategories()
- {
- return $this->newspapercategories;
- }
- // make this all also to a string
- public function __toString()
- {
- return $this->getName();
- }
- }
- <?php
- namespace AppBundleEntity;
- use DoctrineORMMapping as ORM;
- /**
- * newspaper_design
- *
- * @ORMTable(name="newspaper_design")
- * @ORMEntity(repositoryClass="AppBundleRepositorynewspaper_designRepository")
- */
- class newspaper_design
- {
- /**
- * @var int
- *
- * @ORMColumn(name="id", type="integer")
- * @ORMId
- * @ORMGeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * One design has One newspaper.
- * @ORMOneToOne(targetEntity="newspaper_name", inversedBy="newspaperdesign")
- * @ORMJoinColumn(name="np_id", referencedColumnName="id")
- */
- private $newspapername;
- /**
- * @var string
- *
- * @ORMColumn(name="font_size", type="string", length=255)
- */
- private $fontSize;
- /**
- * @var int
- *
- * @ORMColumn(name="columns", type="integer")
- */
- private $columns;
- /**
- * @var string
- *
- * @ORMColumn(name="columns_width", type="string", length=255)
- */
- private $columnsWidth;
- /**
- * @var string
- *
- * @ORMColumn(name="columns_height", type="string", length=255)
- */
- private $columnsHeight;
- /**
- * Get id
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set fontSize
- *
- * @param string $fontSize
- *
- * @return newspaperdesign
- */
- public function setFontSize($fontSize)
- {
- $this->fontSize = $fontSize;
- return $this;
- }
- /**
- * Get fontSize
- *
- * @return string
- */
- public function getFontSize()
- {
- return $this->fontSize;
- }
- /**
- * Set columns
- *
- * @param integer $columns
- *
- * @return newspaperdesign
- */
- public function setColumns($columns)
- {
- $this->columns = $columns;
- return $this;
- }
- /**
- * Get columns
- *
- * @return int
- */
- public function getColumns()
- {
- return $this->columns;
- }
- /**
- * Set columnsWidth
- *
- * @param string $columnsWidth
- *
- * @return newspaperdesign
- */
- public function setColumnsWidth($columnsWidth)
- {
- $this->columnsWidth = $columnsWidth;
- return $this;
- }
- /**
- * Get columnsWidth
- *
- * @return string
- */
- public function getColumnsWidth()
- {
- return $this->columnsWidth;
- }
- /**
- * Set columnsHeight
- *
- * @param string $columnsHeight
- *
- * @return newspaperdesign
- */
- public function setColumnsHeight($columnsHeight)
- {
- $this->columnsHeight = $columnsHeight;
- return $this;
- }
- /**
- * Get columnsHeight
- *
- * @return string
- */
- public function getColumnsHeight()
- {
- return $this->columnsHeight;
- }
- /**
- * Set newspapername
- *
- * @param AppBundleEntitynewspaper_name $newspapername
- *
- * @return newspaper_design
- */
- public function setNewspapername(AppBundleEntitynewspaper_name $newspapername = null)
- {
- $this->newspapername = $newspapername;
- return $this;
- }
- /**
- * Get newspapername
- *
- * @return AppBundleEntitynewspaper_name
- */
- public function getNewspapername()
- {
- return $this->newspapername;
- }
- // make this all also to a string
- public function __toString()
- {
- return $this->getName();
- }
- }
- <?php
- namespace AppBundleForm;
- use SymfonyComponentFormAbstractType;
- use SymfonyComponentFormExtensionCoreTypeTextareaType;
- use SymfonyComponentFormExtensionCoreTypeTextType;
- use SymfonyComponentFormFormBuilderInterface;
- use SymfonyComponentOptionsResolverOptionsResolver;
- use SymfonyBridgeDoctrineFormTypeEntityType;
- class newspaper_nameType extends AbstractType
- {
- /**
- * {@inheritdoc}
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add('name', TextType::class, [
- 'label' => 'authorsite.form.name',
- 'required' => true
- ]);
- $builder->add('description', TextareaType::class, [
- 'label' => 'authorsite.form.name',
- 'required' => true
- ]);
- $builder->add('font_size', EntityType::class, [
- 'class' => 'AppBundleEntitynewspaper_design',
- 'label' => 'authorsite.form.font_size',
- 'required' => true
- ]);
- $builder->add('columns', EntityType::class, [
- 'class' => 'AppBundleEntitynewspaper_design',
- 'label' => 'authorsite.form.columns',
- 'required' => true
- ]);
- }
- /**
- * {@inheritdoc}
- */
- public function configureOptions(OptionsResolver $resolver)
- {
- $resolver->setDefaults(array(
- 'data_class' => 'AppBundleEntitynewspaper_name'
- ));
- }
- /**
- * {@inheritdoc}
- */
- public function getBlockPrefix()
- {
- return 'appbundle_newspaper_name';
- }
- }
Add Comment
Please, Sign In to add comment