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


PHP fRecordSet::count方法代碼示例

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


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

示例1: showRecordSetLinks

 /**
  * Handles the `showLinks()` method for fRecordSet
  *
  * @internal
  *
  * @param fRecordSet   $object       The record set
  * @param string|array $class        The class(es) contained in the record set
  * @param array        &$records     The records
  * @param string       $method_name  The method that was called
  * @param array        $parameters   The parameters passed to the method
  * @return boolean  If the links were shown
  */
 public static function showRecordSetLinks($object, $class, &$records, $method_name, $parameters)
 {
     $template = count($parameters) < 1 ? 'default' : $parameters[0];
     $data = count($parameters) < 2 ? array() : $parameters[1];
     $data = self::extendRecordSetInfo($data, $class);
     return self::showTemplatedLinks($template, $data, $object->getPage(), $object->getLimit(), $object->count(TRUE));
 }
開發者ID:alandsidel,項目名稱:flourish-classes,代碼行數:19,代碼來源:fPagination.php

示例2: setRecordSet

 /**
  * Sets the related records for *-to-many relationships
  *
  * @internal
  *
  * @param  string $class             The class to set the related records for
  * @param  array  &$related_records  The related records existing for the fActiveRecord class
  * @param  string $related_class     The class we are associating with the current record
  * @param  fRecordSet $records       The records are associating
  * @param  string $route             The route to use between the current class and the related class
  * @return void
  */
 public static function setRecordSet($class, &$related_records, $related_class, fRecordSet $records, $route = NULL)
 {
     fActiveRecord::validateClass($related_class);
     fActiveRecord::forceConfigure($related_class);
     $table = fORM::tablize($class);
     $related_table = fORM::tablize($related_class);
     $schema = fORMSchema::retrieve($class);
     $route = fORMSchema::getRouteName($schema, $table, $related_table, $route);
     if (!isset($related_records[$related_table])) {
         $related_records[$related_table] = array();
     }
     if (!isset($related_records[$related_table][$route])) {
         $related_records[$related_table][$route] = array();
     }
     $related_records[$related_table][$route]['record_set'] = $records;
     $related_records[$related_table][$route]['count'] = $records->count();
     $related_records[$related_table][$route]['associate'] = FALSE;
     $related_records[$related_table][$route]['primary_keys'] = NULL;
 }
開發者ID:alandsidel,項目名稱:flourish-classes,代碼行數:31,代碼來源:fORMRelated.php

示例3: setRecordSet

 /**
  * Sets the related records for *-to-many relationships
  * 
  * @internal
  * 
  * @param  string $class             The class to set the related records for
  * @param  array  &$related_records  The related records existing for the fActiveRecord class
  * @param  string $related_class     The class we are associating with the current record
  * @param  fRecordSet $records       The records are associating
  * @param  string $route             The route to use between the current class and the related class
  * @return void
  */
 public static function setRecordSet($class, &$related_records, $related_class, fRecordSet $records, $route = NULL)
 {
     $table = fORM::tablize($class);
     $related_table = fORM::tablize($related_class);
     try {
         $route = fORMSchema::getRouteName($table, $related_table, $route, '*-to-many');
     } catch (fProgrammerException $e) {
         $route = fORMSchema::getRouteName($table, $related_table, $route, 'one-to-one');
     }
     if (!isset($related_records[$related_table])) {
         $related_records[$related_table] = array();
     }
     if (!isset($related_records[$related_table][$route])) {
         $related_records[$related_table][$route] = array();
     }
     $related_records[$related_table][$route]['record_set'] = $records;
     $related_records[$related_table][$route]['count'] = $records->count();
     $related_records[$related_table][$route]['associate'] = FALSE;
     $related_records[$related_table][$route]['primary_keys'] = NULL;
 }
開發者ID:jsuarez,項目名稱:MyDesign,代碼行數:32,代碼來源:fORMRelated.php


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