2

こんにちは、列の 1 つであるテーブルを使用してアプリケーションを作成しましたが、null にすることはできません。値を 0 で永続化している場合。教義はそれをデータベースにnull値として保存しています。コードに列の sort_id 値を保存しようとしています。0 値を 0 整数値として保存する方法は?

これが私のコードです

  namespace cms\models\Entities;

  use \cms\Doctrine\ORM\Mapping as ORM; 
  use \cms\Doctrine;
  use \cms\models\Entities; 
  /**
  * @Entity
  * @Table(name="vkladki")
  */
  class Vkladki{
    /**
     * @Id
     * @Column(type="integer")
     * @GeneratedValue(strategy="AUTO")
     */
    protected $id; 

    /**
     * @Column(type="string", length=255)
     */
    protected $title;

    /**
     * @Column(type="integer")
     */
    protected $cat_id;  

    /**
     * @var integer
     * @Column(type="integer", nullable=false)
     */
    protected $sort_id;  

 public function setSortId( $sort_id){
        $this->sort_id = $sort_id;
    } 
4

0 に答える 0