当前位置: 首页>>代码示例>>PHP>>正文


PHP Notifier::notifyAction方法代码示例

本文整理汇总了PHP中Notifier::notifyAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifier::notifyAction方法的具体用法?PHP Notifier::notifyAction怎么用?PHP Notifier::notifyAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notifier的用法示例。


在下文中一共展示了Notifier::notifyAction方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createLog

 /**
  * Create new log entry and return it
  *
  * Delete actions are automatically marked as silent if $is_silent value is not provided (not NULL)
  *
  * @param ApplicationDataObject $object
  * @param Project $project
  * @param DataManager $manager
  * @param boolean $save Save log object before you save it
  * @return ApplicationReadLog
  */
 static function createLog(ApplicationDataObject $object, $workspaces, $action = null, $save = true, $log_data = '')
 {
     if (is_null($action)) {
         $action = self::ACTION_READ;
     }
     // if
     if (!self::isValidAction($action)) {
         throw new Error("'{$action}' is not valid log action");
     }
     // if
     try {
         Notifier::notifyAction($object, $action, $log_data);
     } catch (Exception $ex) {
     }
     $manager = $object->manager();
     if (!$manager instanceof DataManager) {
         throw new Error('Invalid object manager');
     }
     // if
     $log = new ApplicationReadLog();
     if (logged_user() instanceof Contact) {
         $log->setTakenById(logged_user()->getId());
     } else {
         $log->setTakenById(0);
     }
     $log->setRelObjectId($object->getObjectId());
     $log->setAction($action);
     if ($save) {
         $log->save();
     }
     // if
     return $log;
 }
开发者ID:rorteg,项目名称:fengoffice,代码行数:44,代码来源:ApplicationReadLogs.class.php

示例2: createLog

 /**
  * Create new log entry and return it
  *
  * Delete actions are automatically marked as silent if $is_silent value is not provided (not NULL)
  *
  * @param ApplicationDataObject $object
  * @param Project $project
  * @param DataManager $manager
  * @param boolean $save Save log object before you save it
  * @return ApplicationLog
  */
 static function createLog($object, $action = null, $is_private = false, $is_silent = null, $save = true, $log_data = '')
 {
     $args = array('action' => &$action, 'is_private' => &$is_private, 'is_silent' => &$is_silent, 'save' => &$save, 'log_data' => &$log_data);
     /**
      * Modify log and notification parameters before creating the application log registry
      */
     Hook::fire('application_logs_create', $object, $args);
     if (is_null($action)) {
         $action = self::ACTION_ADD;
     }
     // if
     if (!self::isValidAction($action)) {
         throw new Error("'{$action}' is not valid log action");
     }
     // if
     if ($object instanceof TemplateTask || $object instanceof TemplateMilestone) {
         $is_silent = true;
     }
     if (is_null($is_silent)) {
         $is_silent = $action == self::ACTION_DELETE;
     } else {
         $is_silent = (bool) $is_silent;
     }
     // if
     if (!$is_silent) {
         try {
             Notifier::notifyAction($object, $action, $log_data);
         } catch (Exception $ex) {
             Logger::log($ex->getMessage());
         }
     }
     $log = new ApplicationLog();
     if (logged_user() instanceof Contact) {
         $log->setTakenById(logged_user()->getId());
     } else {
         $log->setTakenById(0);
     }
     if ($object instanceof ContentDataObject) {
         $log->setRelObjectId($object->getObjectId());
         $log->setObjectName($object->getObjectName());
     }
     if ($object instanceof Member) {
         $log->setMemberId($object->getId());
         $log->setRelObjectId($object->getObjectId());
         $log->setObjectName($object->getName());
     }
     $log->setAction($action);
     $log->setIsPrivate($is_private);
     $log->setIsSilent($is_silent);
     $log->setLogData($log_data);
     if ($save) {
         $log->save();
     }
     // if
     return $log;
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:67,代码来源:ApplicationLogs.class.php

示例3: createLog

 /**
  * Create new log entry and return it
  *
  * Delete actions are automatically marked as silent if $is_silent value is not provided (not NULL)
  *
  * @param ApplicationDataObject $object
  * @param Project $project
  * @param DataManager $manager
  * @param boolean $save Save log object before you save it
  * @return ApplicationReadLog
  */
 static function createLog(ApplicationDataObject $object, $workspaces, $action = null, $is_private = false, $is_silent = null, $save = true, $log_data = '')
 {
     if (is_null($action)) {
         $action = self::ACTION_READ;
     }
     // if
     if (!self::isValidAction($action)) {
         throw new Error("'{$action}' is not valid log action");
     }
     // if
     try {
         Notifier::notifyAction($object, $action, $log_data);
     } catch (Exception $ex) {
     }
     $manager = $object->manager();
     if (!$manager instanceof DataManager) {
         throw new Error('Invalid object manager');
     }
     // if
     $log = new ApplicationReadLog();
     if (logged_user() instanceof User) {
         $log->setTakenById(logged_user()->getId());
     } else {
         $log->setTakenById(0);
     }
     $log->setRelObjectId($object->getObjectId());
     $log->setRelObjectManager(get_class($manager));
     $log->setAction($action);
     if ($save) {
         $log->save();
     }
     // if
     if ($save) {
         if ($workspaces instanceof Project) {
             $wo = new WorkspaceObject();
             $wo->setObject($log);
             $wo->setWorkspace($workspaces);
             $wo->save();
         } else {
             if (is_array($workspaces)) {
                 foreach ($workspaces as $w) {
                     if ($w instanceof Project) {
                         $wo = new WorkspaceObject();
                         $wo->setObject($log);
                         $wo->setWorkspace($w);
                         $wo->save();
                     }
                 }
             }
         }
     }
     return $log;
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:64,代码来源:ApplicationReadLogs.class.php

示例4: createLog

	/**
	 * Create new log entry and return it
	 *
	 * Delete actions are automatically marked as silent if $is_silent value is not provided (not NULL)
	 *
	 * @param ApplicationDataObject $object
	 * @param Project $project
	 * @param DataManager $manager
	 * @param boolean $save Save log object before you save it
	 * @return ApplicationLog
	 */
	static function createLog($object, $action = null, $is_private = false, $is_silent = null, $save = true, $log_data = '') {
		if(is_null($action)) {
			$action = self::ACTION_ADD;
		} // if
		if(!self::isValidAction($action)) {
			throw new Error("'$action' is not valid log action");
		} // if

		if(is_null($is_silent)) {
			$is_silent = $action == self::ACTION_DELETE;
		} else {
			$is_silent = (boolean) $is_silent;
		} // if

		if (!$is_silent) {
			try {
				Notifier::notifyAction($object, $action, $log_data);
			} catch (Exception $ex) {
				Logger::log($ex->getMessage());
			}
		}
		
		$log = new ApplicationLog();
		if (logged_user() instanceof Contact) {
			$log->setTakenById(logged_user()->getId());
		} else {
			$log->setTakenById(0);
		}
		if ($object instanceof ContentDataObject) {
			$log->setRelObjectId($object->getObjectId());
			$log->setObjectName($object->getObjectName());
		}
		if ($object instanceof Member) {
			$log->setRelObjectId($object->getId());
			$log->setObjectName($object->getName());
		}
		
		$log->setAction($action);
		$log->setIsPrivate($is_private);
		$log->setIsSilent($is_silent);
		$log->setLogData($log_data);
		
		if($save) {
			$log->save();
		} // if
		
		return $log;
	} // createLog
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:59,代码来源:ApplicationLogs.class.php

示例5: createLog

 /**
  * Create new log entry and return it
  *
  * Delete actions are automatically marked as silent if $is_silent value is not provided (not NULL)
  *
  * @param ApplicationDataObject $object
  * @param Project $project
  * @param DataManager $manager
  * @param boolean $save Save log object before you save it
  * @return ApplicationLog
  */
 static function createLog(ApplicationDataObject $object, $workspaces, $action = null, $is_private = false, $is_silent = null, $save = true, $log_data = '')
 {
     if (is_null($action)) {
         $action = self::ACTION_ADD;
     }
     // if
     if (!self::isValidAction($action)) {
         throw new Error("'{$action}' is not valid log action");
     }
     // if
     if (is_null($is_silent)) {
         $is_silent = $action == self::ACTION_DELETE;
     } else {
         $is_silent = (bool) $is_silent;
     }
     // if
     if (!$is_silent) {
         try {
             Notifier::notifyAction($object, $action, $log_data);
         } catch (Exception $ex) {
         }
     }
     if ($object != null) {
         $manager = $object->manager();
     }
     if (!$manager instanceof DataManager) {
         throw new Error('Invalid object manager');
     }
     // if
     $log = new ApplicationLog();
     if (logged_user() instanceof User) {
         $log->setTakenById(logged_user()->getId());
     } else {
         $log->setTakenById(0);
     }
     $log->setRelObjectId($object->getObjectId());
     $log->setObjectName($object->getObjectName());
     $log->setRelObjectManager(get_class($manager));
     $log->setAction($action);
     $log->setIsPrivate($is_private);
     $log->setIsSilent($is_silent);
     $log->setLogData($log_data);
     if ($save) {
         $log->save();
     }
     // if
     // Update is private for this object
     /*if($object instanceof ProjectDataObject) {
     			ApplicationLogs::setIsPrivateForObject($object);
     		} // if*/
     if ($save) {
         if ($workspaces instanceof Project) {
             $wo = new WorkspaceObject();
             $wo->setObject($log);
             $wo->setWorkspace($workspaces);
             $wo->save();
         } else {
             if (is_array($workspaces)) {
                 foreach ($workspaces as $w) {
                     if ($w instanceof Project) {
                         $wo = new WorkspaceObject();
                         $wo->setObject($log);
                         $wo->setWorkspace($w);
                         $wo->save();
                     }
                 }
             }
         }
     }
     return $log;
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:82,代码来源:ApplicationLogs.class.php


注:本文中的Notifier::notifyAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。