3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.4 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2013
36 require_once 'packages/When/When.php';
38 class CRM_Core_BAO_RecurringEntity
extends CRM_Core_DAO_RecurringEntity
{
40 public $schedule = array();
41 public $scheduleId = NULL;
42 public $scheduleDBParams = array();
44 public $dateColumns = array();
45 public $overwriteColumns = array();
46 public $intervalDateColumns = array();
48 public $excludeDates = array();
50 public $recursion = NULL;
51 public $recursionCounter = NULL;
53 public $isGenRecurringEntity = TRUE;
55 static $_tableDAOMapper =
57 'civicrm_event' => 'CRM_Event_DAO_Event',
58 'civicrm_price_set_entity' => 'CRM_Price_DAO_PriceSetEntity',
59 'civicrm_uf_join' => 'CRM_Core_DAO_UFJoin',
60 'civicrm_tell_friend' => 'CRM_Friend_DAO_Friend',
61 'civicrm_pcp_block' => 'CRM_PCP_DAO_PCPBlock',
62 'civicrm_activity' => 'CRM_Activity_DAO_Activity',
65 static function add(&$params) {
66 if (CRM_Utils_Array
::value('id', $params)) {
67 CRM_Utils_Hook
::pre('edit', 'RecurringEntity', $params['id'], $params);
70 CRM_Utils_Hook
::pre('create', 'RecurringEntity', NULL, $params);
73 $daoRecurringEntity = new CRM_Core_DAO_RecurringEntity();
74 $daoRecurringEntity->copyValues($params);
75 $result = $daoRecurringEntity->save();
77 if (CRM_Utils_Array
::value('id', $params)) {
78 CRM_Utils_Hook
::post('edit', 'RecurringEntity', $daoRecurringEntity->id
, $daoRecurringEntity);
81 CRM_Utils_Hook
::post('create', 'RecurringEntity', $daoRecurringEntity->id
, $daoRecurringEntity);
86 static function quickAdd($parentId, $entityId, $entityTable) {
89 'parent_id' => $parentId,
90 'entity_id' => $entityId,
91 'entity_table' => $entityTable
93 return self
::add($params);
96 function mode($mode) {
98 $this->parent_id
= $this->entity_id
;
102 // generate all new entities based on object vars
103 function generate() {
104 // fixme: check if entityid & entitytable set
105 $this->generateRecursiveDates();
106 CRM_Core_Error
::debug_var('$this->recursionDates1', $this->recursionDates
);
108 return $this->generateEntities();
111 function generateRecursion2() {
112 // return if already generated
113 if (is_a($this->recursion
, 'When')) {
114 return $this->recursion
;
117 if ($this->scheduleId
) {
119 $this->recursion
= $this->getRecursionFromReminder($this->scheduleId
);
120 } else if (!empty($this->schedule
)) {
121 $this->scheduleDBParams
= $this->mapFormValuesToDB($this->schedule
);//call using obj
124 CRM_Core_Error
::debug_var('$this->scheduleDBParams', $this->scheduleDBParams
);
125 if (!empty($this->scheduleDBParams
)) {
126 $this->recursion
= $this->getRecursionFromReminderByDBParams($this->scheduleDBParams
);
128 return $this->recursion
;
131 // generate new DAOs and along with entries in recurring_entity table
132 function generateEntities() {
133 $newEntities = array();
134 if (!empty($this->recursionDates
)) {
135 // save an entry with initiating entity-id & entity-table
136 if (!$this->find(TRUE)) {
137 $this->parent_id
= $this->entity_id
;
141 foreach ($this->recursionDates
as $key => $dateCols) {
142 $newCriteria = $dateCols;
143 foreach ($this->overwriteColumns
as $col => $val) {
144 $newCriteria[$col] = $val;
146 CRM_Core_Error
::debug_var('$newCriteria', $newCriteria);
147 $obj = CRM_Core_BAO_RecurringEntity
::copyCreateEntity($this->entity_table
,
148 array('id' => $this->entity_id
),
150 $this->isGenRecurringEntity
152 $newEntities[] = $obj->id
;
158 function generateRecursiveDates() {
159 $this->generateRecursion2();
161 $recursionDates = array();
162 if (is_a($this->recursion
, 'When')) {
163 $initialCount = CRM_Utils_Array
::value('start_action_offset', $this->scheduleDBParams
);
165 $exRangeStart = $exRangeEnd = NULL;
166 if (!empty($this->excludeDateRangeColumns
)) {
167 $exRangeStart = $this->excludeDateRangeColumns
[0];
168 $exRangeEnd = $this->excludeDateRangeColumns
[1];
172 CRM_Core_Error
::debug_var('$this->intervalDateColumns', $this->intervalDateColumns
);
173 while ($result = $this->recursion
->next()) {
174 $baseDate = CRM_Utils_Date
::processDate($result->format('Y-m-d H:i:s'));
176 foreach ($this->dateColumns
as $col) {
177 $recursionDates[$count][$col] = $baseDate;
179 foreach ($this->intervalDateColumns
as $col => $interval) {
180 $newDate = new DateTime($baseDate);
181 $newDate->add($interval);
182 $recursionDates[$count][$col] = CRM_Utils_Date
::processDate($newDate->format('Y-m-d H:i:s'));
185 $exRangeStartDate = CRM_Utils_Date
::processDate($recursionDates[$count][$exRangeStart], NULL, FALSE, 'Ymd');
186 $exRangeEndDate = CRM_Utils_Date
::processDate($recursionDates[$count][$exRangeEnd], NULL, FALSE, 'Ymd');
190 foreach ($this->excludeDates
as $exDate) {
191 $exDate = CRM_Utils_Date
::processDate($exDate, NULL, FALSE, 'Ymd');
192 if (!$exRangeStart) {
193 if ($exDate == $result->format('Ymd')) {
198 if (($exDate == $exRangeStartDate) ||
199 ($exRangeEndDate && ($exDate > $exRangeStartDate) && ($exDate <= $exRangeEndDate))
208 unset($recursionDates[$count]);
209 if ($initialCount && ($initialCount > 0)) {
210 // lets increase the counter, so we get correct number of occurrences
212 $this->recursion
->count($initialCount);
213 $this->recursionCounter
= $initialCount;
220 $this->recursionDates
= $recursionDates;
221 CRM_Core_Error
::debug_var('$recursionDates', $recursionDates);
223 return $recursionDates;
227 static public function getEntitiesForParent($parentId, $entityTable, $includeParent = TRUE, $mode = 3, $initiatorId = NULL) {
231 $initiatorId = $parentId;
234 $queryParams = array(
235 1 => array($parentId, 'Integer'),
236 2 => array($entityTable, 'String'),
237 3 => array($initiatorId, 'Integer'),
241 $mode = CRM_Core_DAO
::singleValueQuery("SELECT mode FROM civicrm_recurring_entity WHERE entity_id = %3 AND entity_table = %2", $queryParams);
245 FROM civicrm_recurring_entity
246 WHERE parent_id = %1 AND entity_table = %2";
247 if (!$includeParent) {
248 $query .= " AND entity_id != " . ($initiatorId ?
"%3" : "%1");
251 if ($mode == '1') { // MODE = SINGLE
252 $query .= " AND entity_id = %3";
253 } else if ($mode == '2') { // MODE = FUTURE
254 $recurringEntityID = CRM_Core_DAO
::singleValueQuery("SELECT id FROM civicrm_recurring_entity WHERE entity_id = %3 AND entity_table = %2", $queryParams);
255 if ($recurringEntityID) {
256 $query .= $includeParent ?
" AND id >= %4" : " AND id > %4";
257 $query .= " ORDER BY id ASC"; // FIXME: change to order by dates
258 $queryParams[4] = array($recurringEntityID, 'Integer');
260 // something wrong, return empty
265 $dao = CRM_Core_DAO
::executeQuery($query, $queryParams);
266 while ($dao->fetch()) {
267 $entities["{$dao->entity_table}_{$dao->entity_id}"]['table'] = $dao->entity_table
;
268 $entities["{$dao->entity_table}_{$dao->entity_id}"]['id'] = $dao->entity_id
;
273 static public function getEntitiesFor($entityId, $entityTable, $includeParent = TRUE, $mode = 3) {
274 $parentId = self
::getParentFor($entityId, $entityTable);
276 return self
::getEntitiesForParent($parentId, $entityTable, $includeParent, $mode, $entityId);
281 static public function getParentFor($entityId, $entityTable, $includeParent = TRUE) {
284 FROM civicrm_recurring_entity
285 WHERE entity_id = %1 AND entity_table = %2";
286 if (!$includeParent) {
287 $query .= " AND parent_id != %1";
290 CRM_Core_DAO
::singleValueQuery($query,
292 1 => array($entityId, 'Integer'),
293 2 => array($entityTable, 'String'),
299 static public function copyCreateEntity($entityTable, $fromCriteria, $newParams, $createRecurringEntity = TRUE) {
300 $daoName = self
::$_tableDAOMapper[$entityTable];
301 $newObject = CRM_Core_DAO
::copyGeneric($daoName, $fromCriteria, $newParams);
303 if ($newObject->id
&& $createRecurringEntity) {
304 $object = new $daoName( );
305 foreach ($fromCriteria as $key => $value) {
306 $object->$key = $value;
310 CRM_Core_BAO_RecurringEntity
::quickAdd($object->id
, $newObject->id
, $entityTable);
315 static public function triggerUpdate($obj) {
316 // if DB version is earlier than 4.6 skip any processing
317 static $currentVer = NULL;
319 $currentVer = CRM_Core_BAO_Domain
::version();
321 if (version_compare($currentVer, '4.6.alpha1') < 0) {
325 static $processedEntities = array();
326 if (empty($obj->id
) ||
empty($obj->__table
)) {
329 $key = "{$obj->__table}_{$obj->id}";
331 if (array_key_exists($key, $processedEntities)) {
336 // get related entities
337 $repeatingEntities = self
::getEntitiesFor($obj->id
, $obj->__table
, FALSE, NULL);
338 if (empty($repeatingEntities)) {
339 // return if its not a recurring entity parent
342 // mark being processed
343 $processedEntities[$key] = 1;
345 // to make sure we not copying to source itself
346 unset($repeatingEntities[$key]);
348 foreach($repeatingEntities as $key => $val) {
349 $entityID = $val['id'];
350 $entityTable = $val['table'];
352 $processedEntities[$key] = 1;
354 if (array_key_exists($entityTable, self
::$_tableDAOMapper)) {
355 $daoName = self
::$_tableDAOMapper[$entityTable];
357 // FIXME: generalize me
358 $skipData = array('start_date' => NULL,
362 $updateDAO = CRM_Core_DAO
::cascadeUpdate($daoName, $obj->id
, $entityID, $skipData);
363 CRM_Core_DAO
::freeResult();
365 CRM_Core_Error
::fatal("DAO Mapper missing for $entityTable.");
368 // done with processing. lets unset static var.
369 unset($processedEntities);
372 function mapFormValuesToDB($formParams = array()){
374 if(CRM_Utils_Array
::value('used_for', $formParams)){
375 $dbParams['used_for'] = $formParams['used_for'];
378 if(CRM_Utils_Array
::value('parent_event_id', $formParams)){
379 $dbParams['entity_value'] = $formParams['parent_event_id'];
382 if(CRM_Utils_Array
::value('repetition_start_date', $formParams)) {
383 $repetitionStartDate = $formParams['repetition_start_date'];
384 if (CRM_Utils_Array
::value('repetition_start_date_time', $formParams)){
385 $repetitionStartDate = $repetitionStartDate . " " . $formParams['repetition_start_date_time'];
387 $repetition_start_date = new DateTime($repetitionStartDate);
388 $repetition_start_date->modify('+1 day');
389 $dbParams['entity_status'] = CRM_Utils_Date
::processDate($repetition_start_date->format('Y-m-d H:i:s'));
392 if(CRM_Utils_Array
::value('repetition_frequency_unit', $formParams)){
393 $dbParams['repetition_frequency_unit'] = $formParams['repetition_frequency_unit'];
396 if(CRM_Utils_Array
::value('repetition_frequency_interval', $formParams)){
397 $dbParams['repetition_frequency_interval'] = $formParams['repetition_frequency_interval'];
400 //For Repeats on:(weekly case)
401 if($formParams['repetition_frequency_unit'] == 'week'){
402 if(CRM_Utils_Array
::value('start_action_condition', $formParams)){
403 $repeats_on = CRM_Utils_Array
::value('start_action_condition', $formParams);
404 $dbParams['start_action_condition'] = implode(",", array_keys($repeats_on));
408 //For Repeats By:(monthly case)
409 if($formParams['repetition_frequency_unit'] == 'month'){
410 if($formParams['repeats_by'] == 1){
411 if(CRM_Utils_Array
::value('limit_to', $formParams)){
412 $dbParams['limit_to'] = $formParams['limit_to'];
415 if($formParams['repeats_by'] == 2){
416 if(CRM_Utils_Array
::value('start_action_date_1', $formParams) && CRM_Utils_Array
::value('start_action_date_2', $formParams)){
417 $dbParams['start_action_date'] = $formParams['start_action_date_1']." ".$formParams['start_action_date_2'];
422 //For "Ends" - After:
423 if($formParams['ends'] == 1){
424 if(CRM_Utils_Array
::value('start_action_offset', $formParams)){
425 $dbParams['start_action_offset'] = $formParams['start_action_offset'];
430 if($formParams['ends'] == 2){
431 if(CRM_Utils_Array
::value('repeat_absolute_date', $formParams)){
432 $dbParams['absolute_date'] = CRM_Utils_Date
::processDate($formParams['repeat_absolute_date']);
438 static public function getScheduleReminderDetailsById($scheduleReminderId){
440 FROM civicrm_action_schedule WHERE 1";
441 if($scheduleReminderId){
445 $dao = CRM_Core_DAO
::executeQuery($query,
447 1 => array($scheduleReminderId, 'Integer')
454 function getRecursionFromReminder($scheduleReminderId){
455 if($scheduleReminderId){
456 //Get all the details from schedule reminder table
457 $scheduleReminderDetails = self
::getScheduleReminderDetailsById($scheduleReminderId);
458 $scheduleReminderDetails = (array) $scheduleReminderDetails;
459 $recursionDetails = self
::getRecursionFromReminderByDBParams($scheduleReminderDetails);
461 return $recursionDetails;
464 function getRecursionFromReminderByDBParams($scheduleReminderDetails = array()){
466 //If there is some data for this id
467 if($scheduleReminderDetails['repetition_frequency_unit']){
468 if($scheduleReminderDetails['entity_status']){
469 $currDate = date('Y-m-d H:i:s', strtotime($scheduleReminderDetails['entity_status']));
471 $currDate = date("Y-m-d H:i:s");
473 $start = new DateTime($currDate);
474 if($scheduleReminderDetails['repetition_frequency_unit']){
475 $repetition_frequency_unit = $scheduleReminderDetails['repetition_frequency_unit'];
476 if($repetition_frequency_unit == "day"){
477 $repetition_frequency_unit = "dai";
479 $repetition_frequency_unit = $repetition_frequency_unit.'ly';
480 $r->recur($start, $repetition_frequency_unit);
483 if($scheduleReminderDetails['repetition_frequency_interval']){
484 $r->interval($scheduleReminderDetails['repetition_frequency_interval']);
486 $r->errors
[] = 'Repeats every: is a required field';
490 if($scheduleReminderDetails['repetition_frequency_unit'] == 'week'){
491 if($scheduleReminderDetails['start_action_condition']){
492 $startActionCondition = $scheduleReminderDetails['start_action_condition'];
493 $explodeStartActionCondition = explode(',', $startActionCondition);
494 $buildRuleArray = array();
495 foreach($explodeStartActionCondition as $key => $val){
496 $buildRuleArray[] = strtoupper(substr($val, 0, 2));
498 $r->wkst('MO')->byday($buildRuleArray);
503 if($scheduleReminderDetails['repetition_frequency_unit'] == 'month'){
504 if($scheduleReminderDetails['start_action_date']){
505 $startActionDate = explode(" ", $scheduleReminderDetails['start_action_date']);
506 switch ($startActionDate[0]) {
508 $startActionDate1 = 1;
511 $startActionDate1 = 2;
514 $startActionDate1 = 3;
517 $startActionDate1 = 4;
520 $startActionDate1 = -1;
523 $concatStartActionDateBits = $startActionDate1.strtoupper(substr($startActionDate[1], 0, 2));
524 $r->byday(array($concatStartActionDateBits));
525 }else if($scheduleReminderDetails['limit_to']){
526 $r->bymonthday(array($scheduleReminderDetails['limit_to']));
531 if($scheduleReminderDetails['start_action_offset']){
532 if($scheduleReminderDetails['start_action_offset'] > 30){
533 $r->errors
[] = 'Occurrences should be less than or equal to 30';
535 $r->count($scheduleReminderDetails['start_action_offset']);
538 if(CRM_Utils_Array
::value('absolute_date', $scheduleReminderDetails)) {
539 $absoluteDate = CRM_Utils_Date
::setDateDefaults($scheduleReminderDetails['absolute_date']);
540 $endDate = new DateTime($absoluteDate[0].' '.$absoluteDate[1]);
544 if(!$scheduleReminderDetails['start_action_offset'] && !$scheduleReminderDetails['absolute_date']){
545 $r->errors
[] = 'Ends: is a required field';
548 $r->errors
[] = 'Repeats: is a required field';
554 * Get Reminder id based on event id
556 static public function getReminderDetailsByEventId($eventId, $used_for){
560 FROM civicrm_action_schedule
561 WHERE entity_value = %1";
563 $query .= " AND used_for = %2";
566 1 => array($eventId, 'Integer'),
567 2 => array($used_for, 'String')
569 $dao = CRM_Core_DAO
::executeQuery($query, $params);
575 static public function getInterval($startDate, $endDate) {
576 if ($startDate && $endDate) {
577 $startDate = new DateTime($startDate);
578 $endDate = new DateTime($endDate);
580 return $startDate->diff($endDate);
584 static public function generateRecursions($recursionObj, $params = array(), $excludeDates = array()) {
585 $newParams = $recursionResult = array();
586 if (is_a($recursionObj, 'When')) {
587 $initialCount = CRM_Utils_Array
::value('start_action_offset', $params);
588 $interval = CRM_Utils_Array
::value('interval', $params);
591 while ($result = $recursionObj->next()) {
592 $recursionResult[$count]['start_date'] = CRM_Utils_Date
::processDate($result->format('Y-m-d H:i:s'));
595 $endDate = new DateTime($recursionResult[$count]['start_date']);
596 $endDate->add($interval);
597 $recursionResult[$count]['end_date'] = CRM_Utils_Date
::processDate($endDate->format('Y-m-d H:i:s'));
601 foreach ($excludeDates as $date) {
602 $date = CRM_Utils_Date
::processDate($date, NULL, FALSE, 'Ymd');
603 if (($date == $result->format('Ymd')) ||
604 ($endDate && ($date > $result->format('Ymd')) && ($date <= $endDate->format('Ymd')))
612 unset($recursionResult[$count]);
613 if ($initialCount && ($initialCount > 0)) {
614 // lets increase the counter, so we get correct number of occurrences
616 $recursionObj->count($initialCount);
623 return $recursionResult;
626 static public function delEntityRelations($entityId, $entityTable){
627 if(!$entityId && !$entityTable){
630 $parentID = self
::getParentFor($entityId, $entityTable);
632 $dao = new CRM_Core_DAO_RecurringEntity();
633 $dao->parent_id
= $parentID;
634 return $dao->delete();
638 static public function getParticipantCountforEvent($listOfRelatedEntities = array()){
639 if(!empty($listOfRelatedEntities)){
640 $implodeRelatedEntities = implode(',', array_map(function($entity){
641 return $entity['id'];
642 }, $listOfRelatedEntities));
643 if($implodeRelatedEntities){
644 $query = "SELECT p.event_id as event_id,
645 concat_ws(' ', e.title, concat_ws(' - ', DATE_FORMAT(e.start_date, '%b %d %Y %h:%i %p'), DATE_FORMAT(e.end_date, '%b %d %Y %h:%i %p'))) as event_data,
646 count(p.id) as participant_count
647 FROM civicrm_participant p, civicrm_event e
648 WHERE p.event_id = e.id AND p.event_id IN ({$implodeRelatedEntities})
649 GROUP BY p.event_id";
650 $dao = CRM_Core_DAO
::executeQuery($query);
651 $participantDetails = array();
652 while($dao->fetch()) {
653 $participantDetails['countByID'][$dao->event_id
] = $dao->participant_count
;
654 $participantDetails['countByName'][$dao->event_id
][$dao->event_data
] = $dao->participant_count
;
658 return $participantDetails;
661 static function testActivityGeneration() {
662 //Activity set initial params
663 $daoActivity = new CRM_Activity_DAO_Activity();
664 $daoActivity->activity_type_id
= 1;
665 $daoActivity->subject
= "Initial Activity";
666 $daoActivity->activity_date_time
= date('YmdHis');
667 $daoActivity->save();
669 $recursion = new CRM_Core_BAO_RecurringEntity();
670 $recursion->entity_id
= $daoActivity->id
;
671 $recursion->entity_table
= 'civicrm_activity';
672 $recursion->dateColumns
= array('activity_date_time');
673 $recursion->scheduleDBParams
= array(
674 'entity_value' => $daoActivity->id
,
675 'entity_status' => $daoActivity->activity_date_time
,
676 'start_action_date' => 'fourth saturday',
677 'repetition_frequency_unit' => 'month',
678 'repetition_frequency_interval' => 3,
679 'start_action_offset' => 5,
680 'used_for' => 'activity'
683 $generatedEntities = $recursion->generate();
685 // try changing something
686 $recursion->mode(3); // sets ->mode var & saves in DB
688 // lets change subject of initial activity that we created in begining
689 $daoActivity->find(TRUE);
690 $daoActivity->subject
= 'I changed it';
691 $daoActivity->save();
694 static function testEventGeneration(){
695 //Event set initial params
696 $daoEvent = new CRM_Event_DAO_Event();
697 $daoEvent->title
= 'Test event for Recurring Entity';
698 $daoEvent->event_type_id
= 3;
699 $daoEvent->is_public
= 1;
700 $daoEvent->start_date
= date('YmdHis', strtotime('2014-09-24 10:30:00'));
701 $daoEvent->end_date
= date('YmdHis', strtotime('2014-09-26 10:30:00'));
702 $daoEvent->created_date
= date('YmdHis');
703 $daoEvent->is_active
= 1;
706 $recursion = new CRM_Core_BAO_RecurringEntity();
707 $recursion->entity_id
= $daoEvent->id
;
708 $recursion->entity_table
= 'civicrm_event';
709 $recursion->dateColumns
= array('start_date');
710 $recursion->scheduleDBParams
= array (
711 'entity_value' => $daoEvent->id
,
712 'entity_status' => $daoEvent->start_date
,
713 'start_action_condition' => 'wednesday',
714 'repetition_frequency_unit' => 'week',
715 'repetition_frequency_interval' => 1,
716 'start_action_offset' => 4,
717 'used_for' => 'event'
720 $interval = $recursion->getInterval($daoEvent->start_date
, $daoEvent->end_date
);
721 $recursion->intervalDateColumns
= array('end_date' => $interval);
723 $recursion->excludeDates
= array(date('Ymd', strtotime('2014-10-02')), '20141008');// = array('date1', date2, date2)
724 $recursion->excludeDateRangeColumns
= array('start_date', 'end_date');
726 $generatedEntities = $recursion->generate();
727 CRM_Core_Error
::debug_var('$generatedEntities', $generatedEntities);
729 // try changing something
730 $recursion->mode(3); // sets ->mode var & saves in DB
732 $daoEvent->find(TRUE);
733 $daoEvent->title
= 'I changed event';