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


PHP Audit::create方法代码示例

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


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

示例1: audit

 private function audit($markerSite, $action)
 {
     Log::info("Auditing " . $markerSite->id . "for " . $action);
     $data = $this->getAuditData($markerSite);
     $data["action"] = $action;
     Audit::create($data);
 }
开发者ID:skvithalani,项目名称:openmrs-contrib-atlas,代码行数:7,代码来源:AuditService.php

示例2: store

 /**
  * Store a newly created audit in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Audit::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     Audit::create($data);
     return Redirect::route('audits.index');
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:14,代码来源:AuditsController.php

示例3: delete_page

 public function delete_page($args)
 {
     $page_id = array_shift($args);
     if ($page = R::load('page', $page_id)) {
         $old = clone $page;
         R::trash($page);
         Audit::create($old, NULL, 'Developer deleted page from system');
     }
     $this->redirect(PACKAGE_URL);
 }
开发者ID:g2design,项目名称:g2-modules,代码行数:10,代码来源:admin.php

示例4: crud

 function crud($posttype, RedBeanPHP\OODBBean $post_object)
 {
     $fields = $this->get_fields($posttype, false);
     $view = new G2_TwigView('post_form');
     $view->fields = $fields;
     $form = new G2_FormMagic($view->get_render());
     if (!$form->is_posted() && $post_object->getID()) {
         $data = [];
         foreach ($post_object->ownPostdata as $postdata) {
             $data[$postdata->postmeta->fieldname] = $postdata->value;
         }
         $form->set_data($data);
     }
     if ($form->is_posted()) {
         $old = clone $post_object;
         //Save fields to correct db locations
         $postdatas = [];
         foreach ($form->data() as $field => $value) {
             // First Match the field with the correct postdata record from the current post
             unset($postdata);
             foreach ($post_object->ownPostdata as &$data) {
                 if ($data->postmeta->fieldname == $field) {
                     $postdata = $data;
                 }
             }
             if (!isset($postdata)) {
                 $postdata = R::dispense('postdata');
                 $postdata->postmeta = R::findOne('postmeta', 'fieldname = :field AND post_type = :type', ['type' => $posttype, 'field' => $field]);
             }
             $postdata->value = $value;
             R::store($postdata);
             $postdatas[] = $postdata;
         }
         $post_object->ownPostdata = $postdatas;
         $post_object->post_type = $posttype;
         if (!$post_object->getID()) {
             $post_object->date_created = date('Y-m-d H:i:s');
         }
         $post_object->date_modified = date('Y-m-d H:i:s');
         $files = $form->get_uploaded_files();
         R::store($post_object);
         //Save files to
         Audit::create($old, $post_object, 'An Post was saved');
         return true;
     }
     echo $form->parse();
 }
开发者ID:g2design,项目名称:g2-modules,代码行数:47,代码来源:post_model.php

示例5: save_area

 function save_area()
 {
     G2_User::init();
     if (G()->logged_in() && !empty($_POST)) {
         $content = $_POST['content'];
         $area_id = $_POST['area_id'];
         $area = R::findOne('area', 'id = :area', ['area' => $area_id]);
         $old = clone $area;
         $area->html = $content;
         R::store($area);
         Audit::create($old, $area, 'An Area was updated with new content');
         echo json_encode(['success' => true, 'message' => 'Content Saved Successfully']);
     } else {
         echo json_encode(['success' => false, 'message' => 'Not Logged in']);
     }
     die;
 }
开发者ID:g2design,项目名称:g2-modules,代码行数:17,代码来源:ajax.php

示例6: remove

 function remove($args)
 {
     $id = array_shift($args);
     if (is_numeric($id) && ($user = R::load('user', $id))) {
         Audit::create($user, null, 'User was removed from the system');
         R::trash($user);
     }
     $this->redirect(PACKAGE_URL);
 }
开发者ID:g2design,项目名称:g2-modules,代码行数:9,代码来源:admin.php

示例7: update_titles

 /**
  * Update titles of pages in site
  * 
  */
 function update_titles()
 {
     echo 'Load Config <br>';
     $config = new Zend_Config_Ini('meta.ini', APP_DEPLOY);
     $title = $config->meta->title->change;
     $pages_slugs = [];
     $this->filter($title, $pages_slugs);
     $pages = R::findAll('page');
     $meta = new Meta_Generator($config);
     foreach ($pages as $page) {
         $old = clone $page;
         echo "{$page->title} ==== " . $meta->get_title($page->slug) . '<br>';
         echo "{$page->description} ==== " . $meta->get_description($page->slug) . '<br>';
         $page->title = $meta->get_title($page->slug);
         $page->description = $meta->get_description($page->slug);
         Audit::create($old, $page, "Script updated Meta Data");
         R::store($page);
     }
     //		foreach($pages_slugs as $slug => $title){
     //			$page = R::findOne('page','slug = :slug',['slug' => $slug]);
     //			if($page){
     //				echo "$page->title => $title ====   $page->slug<br>";
     //			} else {
     //				echo "$slug Page not Found <br>";
     //			}
     //		}
 }
开发者ID:g2design,项目名称:g2-modules,代码行数:31,代码来源:crud.php

示例8: restore

 function restore($args)
 {
     $what = array_shift($args);
     $id = array_shift($args);
     if (!is_numeric($id) || !($audit = R::load('audit', $id))) {
         $this->redirect(PACKAGE_URL);
     }
     $audit = current(Audit::deserialize([$audit]));
     if ($what == 'new') {
         $bean = $audit->new_obj;
     } else {
         $bean = $audit->old_obj;
     }
     //Retrieve the current record
     $current = R::findOne($bean->getMeta('type'), 'id = :id', array('id' => $bean->id));
     if (!$current) {
         // Record was removed. Thus record needs to be recreated
         //$bean = R::dup($bean);
     }
     $old = $current != null ? clone $current : null;
     if ($current == null) {
         $current = R::dispense($bean->getMeta('type'));
     }
     foreach ($bean as $field => $value) {
         $current->{$field} = $value;
     }
     R::store($current);
     Audit::create($old, $current, "restored to previous version changed on {$audit->date_logged}");
     $this->redirect(PACKAGE_URL);
 }
开发者ID:g2design,项目名称:g2-modules,代码行数:30,代码来源:admin.php


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