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


PHP TActiveRecord::finder方法代码示例

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


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

示例1: SyncWithDimension

 public function SyncWithDimension($sender, $param)
 {
     $cleanmodul = '';
     $SQL = "SELECT * FROM " . $this->Tedsend_tabelle->Text . " WHERE parent_id" . $this->Tedsend_tabelle->Text . " = " . $this->Tedsend_id->Text;
     $cleanmodul = preg_replace("/(^t[a-z]\\_)/", "", $this->Tedsend_tabelle->Text);
     preg_match("/(_[a-z])/", $cleanmodul, $matches);
     if (count($matches) >= 1) {
         $cleanmodul = preg_replace("/(_[a-z])/", ucfirst(substr($matches[1], 1, 1)), $cleanmodul);
     }
     $finderclass = ucfirst($cleanmodul) . "Record";
     $AllRecordsToWrite = TActiveRecord::finder($finderclass)->findAllBySql($SQL);
     $fieldToTransfer = $this->Tedsend_field->Text;
     if (count($AllRecordsToWrite) > 0) {
         foreach ($AllRecordsToWrite as $SingleRecord) {
             $criteria = new TActiveRecordCriteria();
             $criteria->Condition = 'idta_stammdaten_group = :stammdaten_group AND stammdaten_key_extern = :key_extern';
             $criteria->Parameters[':stammdaten_group'] = $this->Tedidta_stammdaten_group->Text;
             $criteria->Parameters[':key_extern'] = $this->Tedsend_tabelle->Text . $SingleRecord->{'id' . $this->Tedsend_tabelle->Text};
             $RecordToChange = StammdatenRecord::finder()->find($criteria);
             if (count($RecordToChange) == 0) {
                 $RecordToChange = new StammdatenRecord();
             }
             $RecordToChange->idta_stammdaten_group = $this->Tedidta_stammdaten_group->Text;
             $RecordToChange->stammdaten_key_extern = $this->Tedsend_tabelle->Text . $SingleRecord->{'id' . $this->Tedsend_tabelle->Text};
             $RecordToChange->stammdaten_name = $SingleRecord->{$fieldToTransfer};
             $RecordToChange->save();
             unset($RecordToChange);
         }
     }
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:30,代码来源:ApplyToDimensionContainer.php

示例2: suggestUser

 public function suggestUser($sender, $param)
 {
     // Get the token
     $token = $param->getToken();
     // Sender is the Suggestions repeater
     $mySQL = "SELECT idtm_user,user_name FROM tm_user WHERE user_name LIKE '%" . $token . "%'";
     $sender->DataSource = PFH::convertdbObjectSuggest(TActiveRecord::finder('UserRecord')->findAllBySQL($mySQL), array('idtm_user', 'user_name'));
     $sender->dataBind();
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:9,代码来源:orgworkspace.php

示例3: suggestOrganisation

 public function suggestOrganisation($sender, $param)
 {
     // Get the token
     $token = $param->getToken();
     // Sender is the Suggestions repeater
     $mySQL = "SELECT idtm_organisation,org_name,org_vorname FROM tm_organisation WHERE org_name LIKE '%" . $token . "%'";
     $sender->DataSource = PFH::convertdbObjectSuggest(TActiveRecord::finder('OrganisationRecord')->findAllBySQL($mySQL), array('idtm_organisation', 'org_name', 'org_vorname'));
     $sender->dataBind();
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:9,代码来源:ImportTasks.php

示例4: test_find_by_sql_arb

    function test_find_by_sql_arb()
    {
        $sql = 'SELECT c.name as category, i.name as item
			FROM items i, categories c
			WHERE i.category_id = c.category_id LIMIT 2';
        $items = TActiveRecord::finder('SqlTest')->findBySql($sql);
        $sql = "SELECT users.*, 'hello' as another_value FROM users LIMIT 2";
        $users = TActiveRecord::finder('UserRecord2')->findBySql($sql);
        var_dump($users);
    }
开发者ID:Nurudeen,项目名称:prado,代码行数:10,代码来源:FindBySqlTestCase.php

示例5: test_finder_throw_exception_when_save

 function test_finder_throw_exception_when_save()
 {
     $obj = TActiveRecord::finder('BaseRecordTest');
     try {
         $obj->save();
         $this->fail();
     } catch (TActiveRecordException $e) {
         $this->pass();
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:10,代码来源:BaseActiveRecordTestCase.php

示例6: finder

 public static function finder($className = __CLASS__)
 {
     return parent::finder($className);
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:4,代码来源:CustomMaskFieldRecord.php

示例7: getForeignRecordFinder

 /**
  * @return TActiveRecord corresponding relationship foreign object finder instance.
  */
 public function getForeignRecordFinder()
 {
     return TActiveRecord::finder($this->getForeignRecordClass());
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:7,代码来源:TActiveRecordRelationContext.php

示例8: getRecordFinder

 /**
  * @return TActiveRecord Active Record finder instance
  */
 protected function getRecordFinder()
 {
     return TActiveRecord::finder($this->getRecordClass());
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:7,代码来源:TScaffoldBase.php

示例9: test_finder_returns_same_instance

 function test_finder_returns_same_instance()
 {
     $obj1 = TActiveRecord::finder('BaseRecordTest');
     $obj2 = TActiveRecord::finder('BaseRecordTest');
     $this->assertSame($obj1, $obj2);
 }
开发者ID:pradosoft,项目名称:prado,代码行数:6,代码来源:BaseActiveRecordTest.php

示例10: getStartNode

 public function getStartNode($idtm_user, $modul, $planungssicht = 0)
 {
     //hier muss noch eine pruefung hin, wenn es mehrere treffer gibt...
     if (count(BerechtigungRecord::finder()->find('idtm_user = ? AND xx_modul = ?', $idtm_user, $modul)) > 0) {
         return BerechtigungRecord::finder()->find('idtm_user = ? AND xx_modul = ?', $idtm_user, $modul)->xx_id;
     } else {
         $SQL = "SELECT id" . $modul . " FROM " . $modul . " WHERE parent_id" . $modul . " = 0";
         if ($planungssicht > 0) {
             $SQL .= " AND idta_stammdatensicht = " . $planungssicht;
             //gilt nur für die planung
         }
         $SQL .= " LIMIT 1";
         $cleanmodul = preg_replace("/(^t[a-z]\\_)/", "", $modul);
         preg_match("/(_[a-z])/", $cleanmodul, $matches);
         if (count($matches) >= 1) {
             $cleanmodul = preg_replace("/(_[a-z])/", ucfirst(substr($matches[1], 1, 1)), $cleanmodul);
         }
         $finderclass = ucfirst($cleanmodul) . "Record";
         $Result = TActiveRecord::finder($finderclass)->findBySql($SQL);
         if (count($Result) >= 1) {
             $tmp = "id" . $modul;
             return $Result->{$tmp};
         } else {
             return 1;
         }
     }
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:27,代码来源:GSProcUser.php


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