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


PHP Repository::update方法代码示例

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


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

示例1: testUpdateSkipsRelations

 public function testUpdateSkipsRelations()
 {
     $homer = $this->repository->findOneBy('name', 'Homer');
     $homer->children = (object) ['pid' => 1, 'name' => 'Bart'];
     $homer->name = 'Foo';
     // Expect no exceptions.
     $this->repository->update($homer);
 }
开发者ID:foothing,项目名称:laravel-repository,代码行数:8,代码来源:EloquentRepositoryTest.php

示例2: update

 /**
  * Update Section
  *
  * @returns Illuminate response (JSON & HTTP code)
  */
 public function update($id, Request $request)
 {
     return $this->pageRepository->update(new Page(), $id, $request);
 }
开发者ID:dan-powell,项目名称:shop,代码行数:9,代码来源:PageController.php

示例3: _

        $error = true;
    }
    if ($doctext == "") {
        $info_error[] = _("Error in the 'text' field (missing required field)");
        $error = true;
    }
    if ($error == false) {
        $parser = new KDB_Parser();
        $parser->proccess_file($doctext, $id_document);
        $info_error = $parser->is_valid();
        if (count($info_error) > 0) {
            $error = true;
        }
    }
    if ($error == false) {
        Repository::update($conn, $id_document, $title, $doctext, $keywords);
    }
}
$sintax = new KDB_Sintax();
$labels_condition = $sintax->_labels_condition;
$labels_actions = $sintax->_labels_actions;
$labels_operators = $sintax->_labels_operators;
$labels_variables = $sintax->_labels_variables;
$help_msgs = array();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> <?php 
echo gettext("OSSIM Framework");
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:repository_editdocument.php

示例4: update

 /**
  * Update Tag
  *
  * @returns Illuminate response (JSON & HTTP code)
  */
 public function update($id, Request $request)
 {
     return $this->tagRepository->update(new Tag(), $id, $request);
 }
开发者ID:dan-powell,项目名称:portfolio,代码行数:9,代码来源:TagController.php

示例5: update

 /**
  * Update a repository
  *
  * @param null
  * @return void
  */
 function update()
 {
     if (!$this->active_repository->canEdit($this->logged_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     $last_commit = $this->active_repository->getLastCommit();
     $revision_to = !instance_of($last_commit, 'Commit') ? 1 : $last_commit->getRevision() + 1;
     $latest_revision = !instance_of($last_commit, 'Commit') ? 0 : $last_commit->getRevision();
     $head_revision = $this->repository_engine->getHeadRevision($this->request->isAsyncCall());
     $bulk_update = array_var($_GET, 'bulk') == '1';
     $uptodate = intval($head_revision == $latest_revision);
     // simple mass update
     if ($this->request->isAsyncCall() == false && $bulk_update) {
         if (is_null($this->repository_engine->error)) {
             $logs = $this->repository_engine->getLogs($revision_to);
             // Loop through array of logs and prepare data for inserting into project_objects table
             if (is_foreachable($logs['data'])) {
                 $this->active_repository->update($logs['data']);
             }
             // if
             if ($logs['total'] > 0) {
                 $this->active_repository->sendToSubscribers($logs['total'], $this->repository_engine);
                 $this->active_repository->createActivityLog($logs['total']);
                 flash_success(lang('Update successfully performed with :total_commits new history entries added.'), array('total_commits' => $logs['total']));
             } else {
                 flash_success(lang('Repository is already up-to-date'));
             }
             // if
         } else {
             flash_error($this->repository_engine->error);
         }
         // if
         $this->redirectToReferer(source_module_url($this->active_project));
     } elseif ($this->request->isAsyncCall()) {
         if (!is_null($this->repository_engine->error)) {
             die($this->repository_engine->error);
         }
         // if
         if (array_var($_GET, 'notify')) {
             $total_commits = $notify_subscribers;
             $this->active_repository->sendToSubscribers($total_commits, $this->repository_engine);
             $this->active_repository->createActivityLog($total_commits);
             die('success');
         }
         // if
         $difference = $head_revision - $latest_revision;
         $more_logs = true;
         if ($difference > SOURCE_MODULE_LOGS_PER_REQUEST) {
             $revision_from = $revision_to + SOURCE_MODULE_LOGS_PER_REQUEST - 1;
         } else {
             $revision_from = $head_revision;
             $more_logs = false;
         }
         // if
         $log = $this->repository_engine->getLogs($revision_to, $revision_from);
         if (is_null($this->repository_engine->error)) {
             $this->active_repository->update($log['data']);
             die($more_logs || $log['total'] > 0 ? 'success' : 'finished');
         } else {
             die($this->repository_engine->error);
         }
         // if
     }
     $this->smarty->assign(array('uptodate' => $uptodate, 'head_revision' => $head_revision, 'last_revision' => $latest_revision, 'repository_update_url' => str_replace('/', '\\/', $this->active_repository->getUpdateUrl()), 'indicator_ok' => ASSETS_URL . '/images/ok_indicator.gif'));
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:72,代码来源:RepositoryController.class.php

示例6: update

 /**
  * Update Project
  *
  * @returns Illuminate response (JSON & HTTP code)
  */
 public function update($id, Request $request)
 {
     return $this->projectRepository->update(new Project(), $id, $request);
 }
开发者ID:RetinaInc,项目名称:portfolio-1,代码行数:9,代码来源:ProjectController.php

示例7: update

 /**
  * Update Section
  *
  * @returns Illuminate response (JSON & HTTP code)
  */
 public function update($id, Request $request)
 {
     return $this->restfulRepository->update(new Section(), $id, $request);
 }
开发者ID:RetinaInc,项目名称:portfolio-1,代码行数:9,代码来源:SectionController.php

示例8: update

 /**
  * 
  * @param string $givenParameters
  * @param string $login
  */
 public static function update($givenParameters, $origin = "form", $route = "", $validate = true, $validateMandatory = true)
 {
     /* Do not perform update if password is empty */
     if (isset($givenParameters['password']) && $givenParameters['password'] == '') {
         unset($givenParameters['password']);
     } elseif (isset($givenParameters['password'])) {
         $givenParameters['password2'] = self::generateHashedPassword($givenParameters);
     }
     if (isset($givenParameters['login']) && !is_null($givenParameters['login']) && !isset($givenParameters['object_id'])) {
         $user = User::getIdByParameter('login', array($givenParameters['login']));
         if (is_array($user) && count($user) > 0) {
             $givenParameters['object_id'] = $user[0];
         }
     }
     $currentDate = date('Y-m-d H:i:s');
     $givenParameters['updatedat'] = $currentDate;
     parent::update($givenParameters, $origin, $route, $validate, $validateMandatory);
 }
开发者ID:NicolasLarrouy,项目名称:centreon,代码行数:23,代码来源:UserRepository.php


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