eZ Community » Forums » Developer » Fetching content of ezdatetime...
expandshrink

Fetching content of ezdatetime attributes with php

Fetching content of ezdatetime attributes with php

Monday 27 May 2013 6:21:01 pm - 1 reply

Hi all,

I'm trying to get to the ezdatetime attributes of a node. I'm trying this:

$event_node = eZContentObjectTreeNode::fetch( $node ); 
$name = $event_node->attribute( 'name' );  
$data_map = $event_node->attribute( 'data_map' );
$to_time = $data_map['to_time']->content();
$to = $to_time->attribute('DateTime');

It returns false. I can get to the other attributes, only not the ezdatetime ones.

How to do it?

Felix

Tuesday 28 May 2013 11:53:36 am

Hi,

$data_map['to_time']->content(); this returns eZDateTime object instance, thus you have to choose one of the available attributes: 'timestamp', 'hour', 'minute', 'second', 'year', 'month', 'day', 'is_valid'

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from