Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How store few objects in same row of db table
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Manel Monguilod  
View profile  
 More options Oct 31 2012, 6:57 am
From: Manel Monguilod <ma...@monguilod.com>
Date: Wed, 31 Oct 2012 03:57:27 -0700 (PDT)
Local: Wed, Oct 31 2012 6:57 am
Subject: Re: How store few objects in same row of db table

Ok. I understand the problem.

You can try with serialize an unserialize, or with json_encode and
json_decode and save the result as a varchar field o longvarchar depending
of the maximum size of data you want to save.

But be careful if the object that you are serializing has dependencies. For
instance, if your object is a Propel object, if you serialize and
unserialize in other session you can have problems retrieving related
objects.

El martes, 30 de octubre de 2012 13:18:40 UTC+1, Ivan Maximenko escribió:

> For example table "Products" have columns "Id", "Name", "Size", "Color",
> "Weight"
> I want work with object product in such way:

> $product = new Product();
> $attrs = new ProductAttrs();
> $attrs->fromArray(array("Weight" => '20', "Color" => "blue", "Size" =>
> "XL"));
> $product->setAttrs($attrs);
> $product->save();

> This is just example, in real application use another entities;

> вторник, 30 октября 2012 г., 13:23:52 UTC+2 пользователь Manel Monguilod
> написал:

>> Hello Ivan,

>> probably I've not understand you problem correctly. What you want to save
>> exactly in the database? serialized objects? attributes of the product? Can
>> you provide a more detailed description?

>> Regards,

>> Manel

>> El lunes, 29 de octubre de 2012 13:39:12 UTC+1, Ivan Maximenko escribió:

>>> Sorry, but I do not understand how this behavior can solve this problem.

>>> воскресенье, 28 октября 2012 г., 16:53:54 UTC+2 пользователь Manel
>>> Monguilod написал:

>>>> Have you tried the aggregate_column behavior?
>>>> http://www.propelorm.org/behaviors/aggregate-column

>>>> El sábado, 27 de octubre de 2012 11:31:28 UTC+2, Ivan Maximenko
>>>> escribió:

>>>>> Hello, Propel Users.

>>>>> How in propel can be save aggregate object and аggregation object in
>>>>> same row of db table.
>>>>> Example, object "Product" aggregates "Attributes" and information
>>>>> about both should be stored in same row of db table.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.