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


PHP Record::load方法代码示例

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


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

示例1: testLoadThrowsExceptionIfNothingSetExplicitlyAndDoesntExistInDatabase

 public function testLoadThrowsExceptionIfNothingSetExplicitlyAndDoesntExistInDatabase()
 {
     $record = new Record(array('id' => 4, 'name' => 'test'), $this->dao, false);
     $this->dao->expects($this->any())->method('getAttributes')->will($this->returnValue(array('id' => Dao::INT, 'name' => Dao::STRING)));
     $this->setExpectedException('RecordException', 'You tried to load a Record which had not attributes set.');
     $record->load();
 }
开发者ID:enyo,项目名称:rincewind,代码行数:7,代码来源:Record.LazyLoading.php

示例2: saveAndLoad

 public function saveAndLoad(Record $record)
 {
     $record->save();
     $loadedRecord = Record::load($record->getTableName(), $record->getId(), get_class($record));
     foreach ($record->getAttributes() as $key => $value) {
         $this->assertEquals($value, $loadedRecord->{$key});
     }
     $record->delete();
 }
开发者ID:Acidburn0zzz,项目名称:xframe-legacy,代码行数:9,代码来源:RecordTest.php

示例3: load

 public function load($iGenreID)
 {
     $oCon = new Connection();
     $sSQL = "SELECT GenreID, GenreName, DisplayOrder \n\t\t\tFROM tbgenres \n\t\t\tWHERE GenreID = " . $iGenreID;
     $oResultSet = $oCon->query($sSQL);
     $aRow = $oCon->fetchArray($oResultSet);
     $this->iGenreID = $aRow['GenreID'];
     $this->sGenreName = $aRow['GenreName'];
     $this->iDisplayOrder = $aRow['DisplayOrder'];
     $sSQL = "SELECT RecordID\n\t\t\tFROM tbrecords \n\t\t\tWHERE GenreID = " . $iGenreID;
     $oResultSet = $oCon->query($sSQL);
     while ($aRow = $oCon->fetchArray($oResultSet)) {
         $iRecordID = $aRow["RecordID"];
         $oRecord = new Record();
         $oRecord->load($iRecordID);
         $this->aRecords[] = $oRecord;
     }
     $oCon->close();
 }
开发者ID:wasim01,项目名称:theRecordBreakers,代码行数:19,代码来源:genre.php

示例4: renderCart

    public static function renderCart($oCart)
    {
        $sHTML = '<table class="cart">';
        $sHTML .= '	<tr>
						<th>Artist</th>
						<th>Title</th>
						<th>Price</th>
						<th>RecordID</th>
						<th>Quantity</th>
					</tr>';
        $aContents = $oCart->contents;
        // echo "<pre>";
        // print_r($aContents);
        // echo "</pre>";
        foreach ($aContents as $iRecordID => $iQuantity) {
            $oRecord = new Record();
            $oRecord->load($iRecordID);
            $sHTML .= '	<tr>
						<td>' . $oRecord->Artist . '</td>
						<td>' . $oRecord->Title . '</td>
						<td>' . $oRecord->Price . '</td>
						<td>' . $oRecord->RecordID . '</td>
						<td>' . $iQuantity . '</td>
						<td class="remove"><a href="removeFromCart.php?RecordID=' . $oRecord->RecordID . '">x</a>
					</tr>';
        }
        $sHTML .= '</table>';
        return $sHTML;
    }
开发者ID:wasim01,项目名称:theRecordBreakers,代码行数:29,代码来源:view.php


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