Well! finally discovered the reason! Because I did set a ManytoOne from Order entity I said previously to Client entity because many orders may belong to one client. So how should I add a new order record when it doesn't accept a productId because this property is manytoone to another entity?
On Wed, Feb 19, 2014 at 4:07 AM, Nima Sadjadi <[email protected]> wrote: > > Here is what I see in DB, no difference between them: > > `order_id` bigint(15) NOT NULL DEFAULT '0', > > `client_id` int(11) NOT NULL DEFAULT '0', > > `product_id` int(11) NOT NULL DEFAULT '0', > > this is what I am trying to flush: > > $this->clientId = 150; > $this->orderId = 200; > $this->productId = 300; > > but only clientID is not passed and missing! here is the mapping of > clientId: > > $metadata->mapField(array( > 'fieldName' => 'clientId', > 'columnName' => 'client_id', > > 'type' => 'integer', > 'nullable' => false, > 'unsigned' => false, > 'comment' => '', > 'default' => '0', > )); > > Strange problem! any idea? > > > > On Wed, Feb 19, 2014 at 2:06 AM, Nima Sadjadi <[email protected]> wrote: > >> >> Herman, >> >> This time I actually did search before posting on group but no useful >> info there: >> >> >> https://www.google.com/?gfe_rd=ctrl&ei=QdsDU_n9MYGI_AafuoGoBQ&gws_rd=cr#q=underscore+doctrine+integer >> >> https://doctrine-orm.readthedocs.org/en/latest/reference/association-mapping.html?highlight=underscore >> >> https://readthedocs.org/search/project/?q=underscore&selected_facets=project%3ADoctrine+DBAL >> >> >> >> >> On Wed, Feb 19, 2014 at 12:47 AM, Nima Sadjadi <[email protected]>wrote: >> >>> before I go ahead and change lots of integer fields of my db that have >>> _, can someone please confirm if this is actually an issue with integer >>> fields? I need to be sure about this before changing because I have many >>> such fields, a nightmare! >>> >>> >>> >>> On Tue, Feb 18, 2014 at 10:59 PM, Nima Sadjadi <[email protected]>wrote: >>> >>>> Can someone explain why fields with _ should be a problem if the type >>>> is integer when flushing? but without _ is okay! >>>> I have this when flushing >>>> $this->cGroup = 1; >>>> >>>> here is field definition: >>>> >>>> $metadata->mapField(array( >>>> 'fieldName' => 'cGroup', >>>> 'columnName' => 'c_group', >>>> 'type' => 'integer', >>>> 'nullable' => false, >>>> 'unsigned' => false, >>>> 'comment' => '', >>>> 'default' => '', >>>> )); >>>> >>>> >>>> >>>> On Tue, Feb 18, 2014 at 10:40 PM, Nima Sadjadi <[email protected]>wrote: >>>> >>>>> I had an integera not nullable field as c_group (of course property is >>>>> cGroup) when I wanted to flush/insert a new record, i was get always >>>>> error >>>>> that it can not be nulled with sqllogget I saw it was null but I actually >>>>> had passed a value to it for insert, but when I renamed the field in db to >>>>> 'group' and applied the changes in entity, problem fixed! This is very >>>>> strange, why integer fields/properties should have problem with _ like >>>>> c_group or may be with caps property as cGroup?! >>>>> I had no such problems with string fields like first_name, but with >>>>> integer fields! >>>>> >>>>> >>>>> >>>> >>>> >>> >> > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/groups/opt_out.
