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.
> 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.
> 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.
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ó:
>> 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.
> 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 написал:
>>> 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 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ó:
> 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 написал:
>>>> 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.
if you don't want to make the attributes fields on the product model (because admins can add/remove attributes at will), you should probably look into a so-called Entity-Attribute-Value setup, where you store products, attributes, and attribute values each in different tables and aggregate all this stuff when querying for products..
This is a bit complex but totally do-able.
You can also look into document-driven databases like MongoDB or CouchDB where you can store whole objects.
> 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 написал:
>>>> 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.
> if you don't want to make the attributes fields on the product model > (because admins can add/remove attributes at will), you should probably > look into a so-called Entity-Attribute-Value setup, where you store > products, attributes, and attribute values each in different tables and > aggregate all this stuff when querying for products..
> This is a bit complex but totally do-able.
> You can also look into document-driven databases like MongoDB or CouchDB > where you can store whole objects.
> Daniel
> On Tuesday, October 30, 2012 5:18:40 AM UTC-7, Ivan Maximenko wrote:
>> For example table "Products" have columns "Id", "Name", "Size", "Color", >> "Weight"
>> I want work with object product in such way:
>> 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 написал:
>>>>> 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.