Share » Forums » Developer » It's possible to Extend provided...

It's possible to Extend provided datatypes?

It's possible to Extend provided datatypes?

Wednesday 24 February 2010 11:45:46 am - 2 replies

Author Message

Carlos Revillo

Thursday 25 February 2010 2:06:36 am

With the help from Bratt at IRC channel, i think i've got a solution. instead of calling parent::__construct, i could just call eZDataType::__construct

So i have now

class customEZPageType extends eZPageType
{
    const DATA_TYPE_STRING = 'customezpage';

    /**
     * Constructor
     *
     */
    function __construct()
    {
        eZDataType::__construct( self::DATA_TYPE_STRING, "Custom Layout" );
    }
    
}

eZDataType::register( customEZPageType::DATA_TYPE_STRING, "customezpagetype" );

Best!

Nicolas Pastorino

Thursday 25 February 2010 2:34:35 am

Looks all good Carlos !

Stupid question : how did you make sure the customEZPageType isused instead of the default class ? It usually is not very easy to override a kernel's datatype.

Cheers !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu