當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Gpf_DbEngine_Row::get方法代碼示例

本文整理匯總了PHP中Gpf_DbEngine_Row::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gpf_DbEngine_Row::get方法的具體用法?PHP Gpf_DbEngine_Row::get怎麽用?PHP Gpf_DbEngine_Row::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gpf_DbEngine_Row的用法示例。


在下文中一共展示了Gpf_DbEngine_Row::get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: validate

 /**
  * Validate Db_Row
  *
  * @param Gpf_DbEngine_Row $row
  * @throws Gpf_DbEngine_Row_ConstraintException
  */
 public function validate(Gpf_DbEngine_Row $row)
 {
     if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH) > Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)) {
         return;
     }
     if (strlen($row->get($this->passwordField)) < Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH)) {
         throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Minimum length of password is %s characters', Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH)));
     }
     if (strlen($row->get($this->passwordField)) > Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)) {
         throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Maximum length of password is %s characters', Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)));
     }
     if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_LETTERS) == Gpf::YES) {
         if (preg_match('/[a-zA-Z]/', $row->get($this->passwordField)) == 0) {
             throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one letter (a-z, A-Z)'));
         }
     }
     if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_DIGITS) == Gpf::YES) {
         if (preg_match('/[0-9]/', $row->get($this->passwordField)) == 0) {
             throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one digit (0-9)'));
         }
     }
     if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_SPECIAL) == Gpf::YES) {
         if (preg_match('/[' . preg_quote(Gpf_Common_String::SPECIAL_CHARS) . ']/', $row->get($this->passwordField)) == 0) {
             throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one special character (%s)', Gpf_Common_String::SPECIAL_CHARS));
         }
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:33,代碼來源:PasswordConstraint.class.php

示例2: validateRefid

 protected function validateRefid(Gpf_DbEngine_Row $row) {
     if ($row->get(Pap_Db_Table_Users::TYPE) == Pap_Application::ROLETYPE_AFFILIATE &&
     !$this->codeValidator->validate($row->get(Pap_Db_Table_Users::REFID))) {
         throw new Gpf_DbEngine_Row_ConstraintException(Pap_Db_Table_Users::REFID,
         $this->_('Refid must be in format "%s". Format definition: {9} - will be replaced by any character in range [0-9], {z} - will be replaced by any character in range [a-z], {Z} - will be replaced by any character in range [A-Z], {X} - will be replaced by any character in range [0-9a-zA-Z], all other characters will be unchanged. Example of good format is e.g. {ZZZ}-{XXXXX}-{999}',
         Gpf_Settings::get(CustomRefid_Config::CUSTOM_REFID_FORMAT)));
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:8,代碼來源:CustomRefidConstraint.class.php

示例3: validate

 /**
  * Validate Db_Row
  *
  * @param Gpf_DbEngine_Row $row
  * @throws Gpf_DbEngine_Row_ConstraintException
  */
 public function validate(Gpf_DbEngine_Row $row)
 {
     if ($row->get(Pap_Db_Table_Users::TYPE) != Pap_Application::ROLETYPE_AFFILIATE) {
         return;
     }
     return parent::validate($row);
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:13,代碼來源:RefIdLengthConstraint.class.php

示例4: validate

 /**
  * Validate Db_Row
  *
  * @param Gpf_DbEngine_Row $row
  * @throws Gpf_DbEngine_Row_ConstraintException
  */
 public function validate(Gpf_DbEngine_Row $row)
 {
     $template = new Gpf_Templates_Template($row->get($this->columnName), '', Gpf_Templates_Template::FETCH_TEXT);
     if (!$template->isValid()) {
         $this->throwException();
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:13,代碼來源:SmartyConstraint.class.php

示例5: execute

 public function execute(Gpf_DbEngine_Row $dbRow)
 {
     if (!$this->isLastUserWithAuthID($dbRow->get(Gpf_Db_Table_Users::AUTHID))) {
         return;
     }
     parent::execute($dbRow);
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:7,代碼來源:Users.class.php

示例6: validate

 /**
  * Validate Db_Row
  *
  * @param Gpf_DbEngine_Row $row
  * @throws Gpf_DbEngine_Row_ConstraintException
  */
 public function validate(Gpf_DbEngine_Row $row)
 {
     $select = new Gpf_SqlBuilder_SelectBuilder();
     $select->select->add('COUNT(*)', 'cnt');
     $select->from->add($row->getTable()->name());
     foreach ($row->getPrimaryColumns() as $primaryColumn) {
         $select->where->add($primaryColumn->getName(), '<>', $row->get($primaryColumn->getName()));
     }
     $conditionNotEqalColumns = new Gpf_SqlBuilder_CompoundWhereCondition();
     foreach ($this->columnsNotEqualNames as $columnNotEqualName) {
         $conditionNotEqalColumns->add($columnNotEqualName, '=', $row->get($this->columnName), 'OR');
     }
     $select->where->addCondition($conditionNotEqalColumns);
     $select->limit->set(0, 1);
     if ($select->getOneRow()->get('cnt') > 0) {
         $this->throwException();
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:24,代碼來源:ColumnsNotEqualConstraint.class.php

示例7: doOneRowLoaded

 /**
  * @throws Gpf_Exception
  */
 protected function doOneRowLoaded(Gpf_DbEngine_Row $row, $tempRow)
 {
     $primaryColumns = $row->getPrimaryColumns();
     foreach ($primaryColumns as $column) {
         if ($tempRow->get($column->getName()) != $row->get($column->getName())) {
             $this->throwException();
         }
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:12,代碼來源:UniqueConstraint.class.php

示例8: execute

 public function execute(Gpf_DbEngine_Row $dbRow)
 {
     if (count($this->foreignDbRow->getTable()->getDeleteConstraints()) == 0) {
         $deleteBuilder = new Gpf_SqlBuilder_DeleteBuilder();
         $deleteBuilder->from->add($this->foreignDbRow->getTable()->name());
         for ($i = 0; $i < count($this->selfColumns); $i++) {
             $deleteBuilder->where->add($this->foreignColumns[$i], "=", $dbRow->get($this->selfColumns[$i]));
         }
         $deleteBuilder->execute();
         return;
     }
     for ($i = 0; $i < count($this->selfColumns); $i++) {
         $this->foreignDbRow->set($this->foreignColumns[$i], $dbRow->get($this->selfColumns[$i]));
     }
     $rowCollection = $this->foreignDbRow->loadCollection($this->foreignColumns);
     foreach ($rowCollection as $row) {
         $row->delete();
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:19,代碼來源:CascadeDeleteConstraint.class.php

示例9: execute

 public function execute(Gpf_DbEngine_Row $dbRow)
 {
     $updateBuilder = new Gpf_SqlBuilder_UpdateBuilder();
     $updateBuilder->from->add($this->foreignDbRow->getTable()->name());
     for ($i = 0; $i < count($this->selfColumns); $i++) {
         $updateBuilder->set->add($this->foreignColumns[$i], 'NULL', false);
         $updateBuilder->where->add($this->foreignColumns[$i], "=", $dbRow->get($this->selfColumns[$i]));
     }
     $updateBuilder->execute();
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:10,代碼來源:SetNullDeleteConstraint.class.php

示例10: execute

 public function execute(Gpf_DbEngine_Row $dbRow)
 {
     for ($i = 0; $i < count($this->selfColumns); $i++) {
         $this->foreignDbRow->set($this->foreignColumns[$i], $dbRow->get($this->selfColumns[$i]));
     }
     $rowCollection = $this->foreignDbRow->loadCollection($this->foreignColumns);
     if ($rowCollection->getSize() > 0) {
         throw new Gpf_DbEngine_RestrictDeleteException($dbRow);
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:10,代碼來源:RestrictDeleteConstraint.class.php

示例11: validate

 /**
  * Validate Db_Row
  *
  * @param Gpf_DbEngine_Row $row
  * @throws Gpf_DbEngine_Row_ConstraintException
  */
 public function validate(Gpf_DbEngine_Row $row)
 {
     $value = $row->get($this->columnName);
     if ($value === null || $value == '') {
         return;
     }
     if (!is_numeric($value)) {
         throw new Gpf_DbEngine_Row_ConstraintException($this->columnName, $this->_("Column %s must be number (%s given)", $this->columnName, $value));
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:16,代碼來源:NumberConstraint.class.php

示例12: isAddingExactlyOneRow

 private function isAddingExactlyOneRow(Gpf_DbEngine_Row $row)
 {
     foreach ($this->uniqueColumnNames as $columnName => $value) {
         if ($value === false) {
             continue;
         }
         if ($row->get($columnName) != $value) {
             return false;
         }
     }
     return true;
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:12,代碼來源:ExactlyOneConstraint.class.php

示例13: validate

 /**
  * Validate Db_Row
  *
  * @param Gpf_DbEngine_Row $row
  * @throws Gpf_DbEngine_Row_ConstraintException
  */
 public function validate(Gpf_DbEngine_Row $row)
 {
     $value = $row->get($this->columnName);
     if ($value == null || $value == "") {
         return;
     }
     if (preg_match($this->regExp, $value) != 1) {
         if ($this->message == "") {
             throw new Gpf_DbEngine_Row_ConstraintException($this->columnName, $this->_("Column %s contains unallowed characters", $this->columnName));
         }
         throw new Gpf_DbEngine_Row_ConstraintException($this->columnName, Gpf_Lang::_replaceArgs($this->message, $value));
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:19,代碼來源:RegExpConstraint.class.php

示例14: loadRow

 protected function loadRow(Gpf_DbEngine_Row $row) {
     $selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
     $selectBuilder->from->add($row->getTable()->name());
     $selectBuilder->select->addAll($row->getTable());
     foreach ($this->uniqueColumnNames as $columnName=>$value) {
         if ($value === false) {
             $selectBuilder->where->add($columnName,'=',$row->get($columnName));
             continue;
         }
         $selectBuilder->where->add($columnName,'=',$value);
     }
     return $selectBuilder->getOneRow();
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:13,代碼來源:ZeroOrOneDefaultCampaignConstraint.class.php

示例15: validate

 /**
  * Validate Db_Row
  *
  * @param Gpf_DbEngine_Row $row
  * @throws Gpf_DbEngine_Row_ConstraintException
  */
 public function validate(Gpf_DbEngine_Row $row)
 {
     foreach ($this->columnMapping as $column => $parentColumn) {
         $this->parentRow->set($parentColumn, $row->get($column));
     }
     if ($this->parentRow->isPrimaryKeyEmpty() && !$this->mandatoryParent) {
         return;
     }
     try {
         $this->parentRow->load();
     } catch (Gpf_Exception $e) {
         //TODO: create new Exception class
         throw new Gpf_DbEngine_Row_ConstraintException('', $this->message);
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:21,代碼來源:RelationConstraint.class.php


注:本文中的Gpf_DbEngine_Row::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。