当前位置: 首页>>代码示例>>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;未经允许,请勿转载。