Note that there are some explanatory texts on larger screens.

plurals
  1. POGeneral error: 1366 Incorrect integer value with Doctrine 2.1 and Zend Form update
    primarykey
    data
    text
    <p>I am processing a submitted Zend Form which updates a Doctrine Record using the following code, where $query is a query built using a doctrine query builder:</p> <pre><code>$record_array = $query-&gt;getResult(); $this-&gt;_record = $record_array[0]; if($this-&gt;getRequest()-&gt;isPost()) { if ($this-&gt;_form-&gt;isValid($this-&gt;_request-&gt;getPost())) { $newEntity = $this-&gt;_form-&gt;update($this-&gt;_record); $this-&gt;_em-&gt;flush(); $this-&gt;view-&gt;success = 'Record Saved.'; } else { $this-&gt;view-&gt;errors = $this-&gt;_form-&gt;getErrors(); } } </code></pre> <p>The above works fine if there are no integers in the record, i.e. only strings. However, I get the error above if I include fields on the form which are mapped as integers in the doctrine entity.</p> <p>Any help would be appreciated.</p> <p>UPDATE:</p> <pre><code>/** * @var integer $solicitorid * * @Column(name="SolicitorID", type="integer", nullable=false) * @Id * @GeneratedValue(strategy="IDENTITY") */ private $solicitorid; /** * @var string $solicitor * * @Column(name="Solicitor", type="string", length=160, nullable=true) */ private $solicitor; /** * @var string $address * * @Column(name="Address", type="string", length=160, nullable=true) */ private $address; /** * @var string $town * * @Column(name="Town", type="string", length=100, nullable=true) */ private $town; /** * @var string $county * * @Column(name="County", type="string", length=100, nullable=true) */ private $county; /** * @var string $postcode * * @Column(name="Postcode", type="string", length=100, nullable=true) */ private $postcode; /** * @var string $dxaddress * * @Column(name="DXAddress", type="string", length=150, nullable=true) */ private $dxaddress; /** * @var string $phone * * @Column(name="phone", type="string", length=30, nullable=true) */ private $phone; /** * @var string $fax * * @Column(name="fax", type="string", length=30, nullable=true) */ private $fax; /** * @var string $email * * @Column(name="email", type="string", length=255, nullable=true) */ private $email; /** * @var string $password * * @Column(name="password", type="string", length=30, nullable=false) */ private $password; /** * @var integer $leadStatus * * @Column(name="lead_status", type="integer", nullable=true) */ private $leadStatus; /** * @var string $termsref * * @Column(name="termsRef", type="string", length=10, nullable=true) */ private $termsref; /** * @var integer $termsconditions * * @Column(name="termsconditions", type="integer", nullable=true) */ private $termsconditions; /** * @var date $termssent * * @Column(name="termsSent", type="date", nullable=true) */ private $termssent; /** * @var date $termssigneddate * * @Column(name="termssigneddate", type="date", nullable=true) */ private $termssigneddate; /** * @var integer $paymentterms * * @Column(name="paymentterms", type="integer", nullable=true) */ private $paymentterms; /** * @var integer $discountterms * * @Column(name="discountterms", type="integer", nullable=true) */ private $discountterms; /** * @var float $discountrate * * @Column(name="discountrate", type="float", nullable=true) */ private $discountrate; /** * @var integer $accountscontact * * @Column(name="AccountsContact", type="integer", nullable=true) */ private $accountscontact; /** * @var date $warned * * @Column(name="warned", type="date", nullable=true) */ private $warned; /** * @var float $feerate * * @Column(name="FeeRate", type="float", nullable=true) */ private $feerate; /** * @var string $labourrate * * @Column(name="LabourRate", type="string", length=100, nullable=true) */ private $labourrate; /** * @var text $specialinst * * @Column(name="SpecialInst", type="text", nullable=true) */ private $specialinst; /** * @var text $reportinst * * @Column(name="ReportInst", type="text", nullable=true) */ private $reportinst; /** * @var boolean $autostatement * * @Column(name="AutoStatement", type="boolean", nullable=true) */ private $autostatement; /** * @var datetime $lastmodifed * * @Column(name="lastModifed", type="datetime", nullable=false) */ private $lastmodifed; </code></pre> <p>Above is the entity. The issue comes when I try to update an integer field.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload