here is my array i get
Array
(
[0] => BugHerd_Project Object
(
[id:BugHerd_Project:private] => 24323
[name:BugHerd_Project:private] => bugherd a
[devurl:BugHerd_Project:private] => http://st.com/a/
[active:BugHerd_Project:private] => 1
[created:BugHerd_Project:private] => DateTime Object
(
[date] => 2014-05-03 11:15:22
[timezone_type] => 2
[timezone] => Z
)
[updated:BugHerd_Project:private] => DateTime Object
(
[date] => 2014-05-05 06:55:52
[timezone_type] => 2
[timezone] => Z
)
)
)
/** * Gets date the project was last created * @return DateTime Project creation date */
public function getCreated() {
return $this->created;
}
i have written below code for to access date from array
on doing print_r($projects_particular->getCreated());
output of array is here :
DateTime Object ( [date] => 2014-05-05 10:04:30 [timezone_type] => 2 [timezone] => Z )
i recived error:Catchable fatal error: Object of class DateTime could not be converted to string
- im just want to access date.