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


PHP Branch::getId方法代码示例

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


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

示例1: synchronize

 /**
  * @static
  * @param GitCommand $gitCommand
  * @param Branch $branch
  * @param string $lastBranchSynchronizationCommit
  * @return int 0 if succeed
  */
 public static function synchronize(GitCommand $gitCommand, Branch $branch, $lastBranchSynchronizationCommit = null)
 {
     $filesGit = $gitCommand->getDiffFilesFromBranch($branch->getRepository()->getGitDir(), $branch->getCommitReference(), $branch->getLastCommit());
     if (count($filesGit) > sfConfig::get('app_max_number_of_files_to_review', 4096)) {
         return count($filesGit);
     }
     $filesModel = FileQuery::create()->filterByBranchId($branch->getId())->find();
     if (count($filesModel) > 0) {
         $diffFilesFromLastSynch = $gitCommand->getDiffFilesFromBranch($branch->getRepository()->getGitDir(), !is_null($lastBranchSynchronizationCommit) ? $lastBranchSynchronizationCommit : $branch->getCommitReference(), $branch->getLastCommit(), false);
     }
     foreach ($filesModel as $fileModel) {
         /** @var $fileModel File */
         if (!array_key_exists($fileModel->getFilename(), $filesGit)) {
             $fileModel->delete();
         } else {
             $lastChangeCommit = $gitCommand->getLastModificationCommit($branch->getRepository()->getGitDir(), $branch->getName(), $fileModel->getFilename());
             if (isset($diffFilesFromLastSynch[$fileModel->getFilename()])) {
                 $fileModel->setReviewRequest(true)->setStatus(BranchPeer::A_TRAITER)->setCommitStatusChanged($lastChangeCommit);
             } else {
                 $fileModel->setReviewRequest(false);
             }
             if ($filesGit[$fileModel->getFilename()]['is-binary']) {
                 $fileModel->setIsBinary(true)->setNbAddedLines(0)->setNbDeletedLines(0);
             } else {
                 $fileModel->setIsBinary(false)->setNbAddedLines($filesGit[$fileModel->getFilename()]['added-lines'])->setNbDeletedLines($filesGit[$fileModel->getFilename()]['deleted-lines']);
             }
             $fileModel->setState($filesGit[$fileModel->getFilename()]['state'])->setLastChangeCommit($lastChangeCommit)->setCommitInfos($gitCommand->getCommitInfos($branch->getRepository()->getGitDir(), $lastChangeCommit, "%ce %s"))->setCommitReference($branch->getCommitReference())->save();
         }
         unset($filesGit[$fileModel->getFilename()]);
     }
     foreach ($filesGit as $fileGit) {
         $lastChangeCommit = $gitCommand->getLastModificationCommit($branch->getRepository()->getGitDir(), $branch->getName(), $fileGit['filename']);
         $file = new File();
         if ($fileGit['is-binary']) {
             $file->setIsBinary(true)->setNbAddedLines(0)->setNbDeletedLines(0);
         } else {
             $file->setIsBinary(false)->setNbAddedLines($fileGit['added-lines'])->setNbDeletedLines($fileGit['deleted-lines']);
         }
         $file->setFilename($fileGit['filename'])->setStatus(BranchPeer::A_TRAITER)->setState($fileGit['state'])->setBranchId($branch->getId())->setLastChangeCommit($lastChangeCommit)->setCommitInfos($gitCommand->getCommitInfos($branch->getRepository()->getGitDir(), $lastChangeCommit, "%ce %s"))->setCommitReference($branch->getCommitReference())->setReviewRequest(true)->save();
     }
     return 0;
 }
开发者ID:ratibus,项目名称:Crew,代码行数:49,代码来源:FilePeer.php

示例2: Branch

     }
 } else {
     if ($_POST['type'] == "delete") {
         try {
             $branch = new Branch($_POST['key']);
             $branch->delete();
         } catch (fExpectedException $e) {
             echo $e->printMessage();
         }
     } else {
         if ($_POST['type'] == "add") {
             try {
                 $branch = new Branch();
                 $branch->populate();
                 $branch->store();
                 $theId = $branch->getId();
                 $ids = Inv_item::findIdUB($db);
                 foreach ($ids as $id) {
                     $stock = new Inv_stock();
                     $stock->setBranchId($theId);
                     $stock->setItemId($id);
                     $stock->setQuantity(0);
                     $stock->store();
                 }
             } catch (fExpectedException $e) {
                 echo $e->printMessage();
             }
         } else {
             if ($_POST['type'] == "name") {
                 $branch = new Branch($_POST['key']);
                 echo $branch->prepareName();
开发者ID:JhunCabas,项目名称:material-management,代码行数:31,代码来源:Branch.php

示例3: filterByBranch

 /**
  * Filter the query by a related Branch object
  *
  * @param     Branch|PropelCollection $branch The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    CommentQuery The current query, for fluid interface
  */
 public function filterByBranch($branch, $comparison = null)
 {
     if ($branch instanceof Branch) {
         return $this->addUsingAlias(CommentPeer::BRANCH_ID, $branch->getId(), $comparison);
     } elseif ($branch instanceof PropelCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(CommentPeer::BRANCH_ID, $branch->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByBranch() only accepts arguments of type Branch or PropelCollection');
     }
 }
开发者ID:ratibus,项目名称:Crew,代码行数:21,代码来源:BaseCommentQuery.php

示例4: executeBulkupload

 public function executeBulkupload()
 {
     if ($this->getRequest()->getFileName('csvfile')) {
         $fileName = md5($this->getRequest()->getFileName('csvfile') . time() . rand(0, 99999));
         $ext = $this->getRequest()->getFileExtension('csvfile');
         $this->getRequest()->moveFile('csvfile', sfConfig::get('sf_upload_dir') . "//csvfiles//" . $fileName . ".csv");
         $fullname = $fileName . ".csv";
         //$fullpath = '/uploads/csvfiles/'.$fullname;
         $fp = sfConfig::get('sf_upload_dir') . "//csvfiles//" . $fileName . ".csv";
         $reader = new sfCsvReader($fp, ',', '"');
         $reader->open();
         $i = 1;
         $exist;
         $ignore;
         $log;
         $ignoreflag = 0;
         $success = 0;
         while ($data = $reader->read()) {
             $name[] = array();
             $name = explode(' ', $data[0]);
             $roll = $data[1];
             $enrol = $data[2];
             $branch = $data[3];
             $degree = $data[4];
             $year = $data[5];
             $c = new Criteria();
             $c->add(UserPeer::ENROLMENT, $enrol);
             $user = UserPeer::doSelectOne($c);
             if (!$user) {
                 $c = new Criteria();
                 $c->add(BranchPeer::CODE, $branch);
                 $br = BranchPeer::doSelectOne($c);
                 if (!$br) {
                     $br = new Branch();
                     $br->setName($branch);
                     $br->setCode($branch);
                     $br->save();
                 }
                 $c = new Criteria();
                 $c->add(DegreePeer::NAME, $degree);
                 $dg = DegreePeer::doSelectOne($c);
                 if (!$dg) {
                     $dg = new Degree();
                     $dg->setName($degree);
                     $dg->save();
                 }
                 $user = new User();
                 if ($roll) {
                     $user->setRoll($roll);
                     $user->setRollflag(sfConfig::get('app_defaultprivacy_roll'));
                 }
                 if ($enrol) {
                     $user->setEnrolment($enrol);
                     $user->setEnrolflag(sfConfig::get('app_defaultprivacy_enrol'));
                 } else {
                     $ignoreflag = 1;
                 }
                 if ($year) {
                     $user->setGraduationyear($year);
                     $user->setGraduationyearflag(sfConfig::get('app_defaultprivacy_year'));
                 }
                 $user->setBranchId($br->getId());
                 $user->setBranchflag(sfConfig::get('app_defaultprivacy_branch'));
                 $user->setDegreeId($dg->getId());
                 $user->setDegreeflag(sfConfig::get('app_defaultprivacy_degree'));
                 $user->setIslocked(sfConfig::get('app_islocked_unclaimed'));
                 $user->setUsertype(sfConfig::get('app_usertypecode_Alumni'));
                 $lastname = '';
                 $personal = new Personal();
                 $name[0] = str_replace('.', '', $name[0]);
                 $personal->setFirstname($name[0]);
                 if ($name[3]) {
                     $name[1] = str_replace('.', '', $name[1]);
                     $name[2] = str_replace('.', '', $name[2]);
                     $name[3] = str_replace('.', '', $name[3]);
                     $midname = $name[1] . " " . $name[2];
                     $personal->setMiddlename($midname);
                     $personal->setLastname($name[3]);
                     $lastname = $name[3];
                 } elseif ($name[2]) {
                     $name[1] = str_replace('.', '', $name[1]);
                     $name[2] = str_replace('.', '', $name[2]);
                     $personal->setMiddlename($name[1]);
                     $personal->setLastname($name[2]);
                     $lastname = $name[2];
                 } elseif ($name[1]) {
                     $name[1] = str_replace('.', '', $name[1]);
                     $personal->setLastname($name[1]);
                     $lastname = $name[1];
                 }
                 $uname_suffix = $branch . substr($year, -2);
                 if ($lastname) {
                     $username = $name[0] . '.' . $lastname . '@';
                 } else {
                     $username = $name[0] . '@';
                 }
                 $temp = 1;
                 $tempusername = $username;
                 while ($this->uniqueuser($tempusername . $uname_suffix)) {
                     $tempusername = $username . $temp;
//.........这里部分代码省略.........
开发者ID:Ayaan123,项目名称:alumnisangam,代码行数:101,代码来源:actions.class.php

示例5: Branch

		<label for="branch_id">From Branch </label>
				<?php 
        $fromBranch = new Branch($mattrans->getBranchFrom());
        echo $fromBranch->prepareName();
        ?>
		<label for="branch_id"> To Branch </label>
			<?php 
        $toBranch = new Branch($mattrans->getBranchTo());
        echo $toBranch->prepareName();
        ?>
<br />
		<table id="formContent">
			<thead>
				<tr><th>No</th>
					<th>Item Code</th><th width="300px">Description</th><th>Quantity</th><th>UOM</th><th>Remarks</th><th>In <?php 
        echo $fromBranch->getId();
        ?>
</th><th width="75px">Receiver</th></tr>
			</thead>
			<tbody>
				<?php 
        $counter = 1;
        foreach ($mattrans_details as $mattrans_detail) {
            echo "<tr class=\"jsonRow\"><td>" . $counter . "</td><td class=\"itemCode\">" . $mattrans_detail->prepareItemId() . "<input class=\"itemId\" type=\"hidden\" value=\"" . $mattrans_detail->getId() . "\"></input></td>";
            $item = new Inv_item($mattrans_detail->getItemId());
            echo "<td>" . $item->prepareDescription() . "</td><td class=\"itemQuan\">" . $mattrans_detail->prepareQuantity() . "</td>\n\t\t\t\t\t\t\t \t<td>" . $item->prepareUnitOfMeasure() . "</td><td>" . $mattrans_detail->prepareRemark() . "</td>";
            $tempRecords = Inv_stock::findStockByBranch($mattrans_detail->getItemId(), $mattrans->getBranchFrom());
            $quanRow = 0;
            foreach ($tempRecords as $tempRecord) {
                $quanRow = $tempRecord->getQuantity();
            }
开发者ID:JhunCabas,项目名称:material-management,代码行数:31,代码来源:document-mtr-view.php

示例6: prune

 /**
  * Exclude object from result
  *
  * @param     Branch $branch Object to remove from the list of results
  *
  * @return    BranchQuery The current query, for fluid interface
  */
 public function prune($branch = null)
 {
     if ($branch) {
         $this->addUsingAlias(BranchPeer::ID, $branch->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
开发者ID:ratibus,项目名称:Crew,代码行数:14,代码来源:BaseBranchQuery.php

示例7: setBranch

 /**
  * Declares an association between this object and a Branch object.
  *
  * @param      Branch $v
  * @return     File The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setBranch(Branch $v = null)
 {
     if ($v === null) {
         $this->setBranchId(NULL);
     } else {
         $this->setBranchId($v->getId());
     }
     $this->aBranch = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Branch object, it will not be re-added.
     if ($v !== null) {
         $v->addFile($this);
     }
     return $this;
 }
开发者ID:ratibus,项目名称:Crew,代码行数:22,代码来源:BaseFile.php


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