dongzongzi0379 2015-12-12 21:57
浏览 39

Doctrine Schema更新。 俯瞰实体

I have created 2 new entities and when I run

app/console doctrine:schema:update --force

It says i am up to date and these two new entities do not get tables created.

Every other command i have found will detect entities in other bundles but none from the bundle i am working on. Example would be

app/console doctrine:mapping:info

It does not show there either.

Here is a example of one. This lives in the Entity Folder of my bundle

<?php

namespace test\OrganizationBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;

/**
 * Department
 * @ORM\Entity
 * @ORM\Table(name="departments")
 */
class Department
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="bigint", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
      * 
     * @ORM\Column(name="name", type="string", length=50, nullable=false)
     */
    private $name;

    /**
     * @var integer
     * @ORM\Column(name="facilityId", type="int")
     *
     */
    private $facilityId;

    /**
     * @var \DateTime
     * @ORM\Column(name="created", type="datetime")
     */
    private $created;

    /**
     * @var \DateTime
     * @ORM\Column(name="updated", type="datetime")
     */
    private $updated;

    /**
     * @var array
     * @ORM\ManyToMany(targetEntity="DeptTag", mappedBy="departments")
     */
    private $deptTags;



     public function __construct()
      {
        $this->deptTags = new ArrayCollection();
      }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return Department
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set facilityId
     *
     * @param string $facilityId
     *
     * @return Department
     */
    public function setFacilityId($facilityId)
    {
        $this->facilityId = $facilityId;

        return $this;
    }

    /**
     * Get facilityId
     *
     * @return string
     */
    public function getFacilityId()
    {
        return $this->facilityId;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     *
     * @return Department
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set updated
     *
     * @param \DateTime $updated
     *
     * @return Department
     */
    public function setUpdated($updated)
    {
        $this->updated = $updated;

        return $this;
    }

    /**
     * Get updated
     *
     * @return \DateTime
     */
    public function getUpdated()
    {
        return $this->updated;
    }

    /**
     * Set deptTags
     *
     * @param array $deptTags
     *
     * @return Department
     */
    public function setDeptTags($deptTags)
    {
        $this->deptTags = $deptTags;

        return $this;
    }

    /**
     * Get deptTags
     *
     * @return array
     */
    public function getDeptTags(DeptTag)
    {
        return $this->deptTags[] = $deptTag;
    }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)