Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Mapping Drivers, ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      MySQL, pdo_mysql, Symfony2

      Description

      I'm having issues working with Doctrine2 boolean type. My mapping is basic:

      	/**
      	 * @orm:Column(type="boolean", nullable=false, name="is_deleted")
      	 */
      	protected $isDeleted;
      

      When I'm trying to flush the object with $isDeleted=false (or true), the entity is not being added to the db. However when I set $isDeleted='0' (or '1') everything works fine.

      I saw plenty of examples where people were using true and false, instead of '0' and '1'. But with MySQL it doesn't work. Doctrine maps boolean field as TINYINT(1) in MySQL. And I can see in Symfony2 Profiler the parameter in the query is "false"/"true", so here is data type conflict.

      Doctrine doesn't transform true/false to 1/0 values.

        Issue Links

          Activity

          Nikita Korotaev created issue -
          Nikita Korotaev made changes -
          Field Original Value New Value
          Description I'm having issues working with Doctrine2 boolean type. My mapping is basic:

          /**
          * @orm:Column(type="boolean", nullable=false, name="is_deleted")
          */
          protected $isDeleted;

          When I'm trying to flush the object with $isDeleted=false (or true), the entity is not being added to the db. However when I set $isDeleted='0' (or '1') everything works fine.

          I saw plenty of examples where people were using true and false, instead of '0' and '1'. But with MySQL it doesn't work. Doctrine maps boolean field as TINYINT(1) in MySQL.
          I'm having issues working with Doctrine2 boolean type. My mapping is basic:

          /**
          * @orm:Column(type="boolean", nullable=false, name="is_deleted")
          */
          protected $isDeleted;

          When I'm trying to flush the object with $isDeleted=false (or true), the entity is not being added to the db. However when I set $isDeleted='0' (or '1') everything works fine.

          I saw plenty of examples where people were using true and false, instead of '0' and '1'. But with MySQL it doesn't work. Doctrine maps boolean field as TINYINT(1) in MySQL. And I can see in Symfony2 Profiler the parameter in the query is "false"/"true", so here is data type conflict.

          Doctrine doesn't transform true/false to 1/0 values.
          Benjamin Eberlei made changes -
          Link This issue relates to DDC-1394 [ DDC-1394 ]
          Benjamin Eberlei made changes -
          Description I'm having issues working with Doctrine2 boolean type. My mapping is basic:

          /**
          * @orm:Column(type="boolean", nullable=false, name="is_deleted")
          */
          protected $isDeleted;

          When I'm trying to flush the object with $isDeleted=false (or true), the entity is not being added to the db. However when I set $isDeleted='0' (or '1') everything works fine.

          I saw plenty of examples where people were using true and false, instead of '0' and '1'. But with MySQL it doesn't work. Doctrine maps boolean field as TINYINT(1) in MySQL. And I can see in Symfony2 Profiler the parameter in the query is "false"/"true", so here is data type conflict.

          Doctrine doesn't transform true/false to 1/0 values.
          I'm having issues working with Doctrine2 boolean type. My mapping is basic:

          {code}
          /**
          * @orm:Column(type="boolean", nullable=false, name="is_deleted")
          */
          protected $isDeleted;
          {code}

          When I'm trying to flush the object with $isDeleted=false (or true), the entity is not being added to the db. However when I set $isDeleted='0' (or '1') everything works fine.

          I saw plenty of examples where people were using true and false, instead of '0' and '1'. But with MySQL it doesn't work. Doctrine maps boolean field as TINYINT(1) in MySQL. And I can see in Symfony2 Profiler the parameter in the query is "false"/"true", so here is data type conflict.

          Doctrine doesn't transform true/false to 1/0 values.
          Alexander made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          Alexander made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Cannot Reproduce [ 5 ]
          Benjamin Eberlei made changes -
          Workflow jira [ 12432 ] jira-feedback [ 15667 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback [ 15667 ] jira-feedback2 [ 17531 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback2 [ 17531 ] jira-feedback3 [ 19788 ]

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Nikita Korotaev
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: