Forums / Developer / Attribute class automatically fill when object is created

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Attribute class automatically fill when object is created

Author Message

Albert Balagueró

Monday 18 July 2011 6:08:36 am

Hi,
I would like to know if is it possible that when user creates a new object of a class, this object gets the value of a class attribute automatically. I mean: the user creates an object that have "number" attribute, "title" attribute and "descripction" attribute, is there a way to give the object's "number" attribute automatically a value? The first created, must be 001 (for example), the second, 002; the third, 003; this attribute will increase +1 at each new creation...
Thaks. 

Damien Pobel

Monday 18 July 2011 6:24:17 am

Hi Albert,

If you just want to increment an attribute on each object creation you can add an identifier attribute to your content class and Exponential will do the rest automagically ;-)

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Albert Balagueró

Monday 18 July 2011 6:36:04 am

Hi Damien,
I am ashamed, it was so simple... I didn't know ant test either this class attribute.

Thank you for your fast response.
Cheers!