本文整理汇总了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));
}
示例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;
}
示例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;
}