*
* @return IORMRow
*/
- public function newFromDBResult( stdClass $result );
+ public function newRowFromDBResult( stdClass $result );
/**
* Get a new instance of the class from an array.
*
* @return IORMRow
*/
- public function newFromArray( array $data, $loadDefaults = false );
+ public function newRow( array $data, $loadDefaults = false );
/**
* Return the names of the fields.
$objects = array();
foreach ( $result as $record ) {
- $objects[] = $this->newFromArray( $record );
+ $objects[] = $this->newRow( $record );
}
return $objects;
}
/**
- * Get a new instance of the class from a database result.
+ * @see ORMTable::newRowFromFromDBResult
*
+ * @deprecated use newRowFromFromDBResult instead
* @since 1.20
*
* @param stdClass $result
* @return IORMRow
*/
public function newFromDBResult( stdClass $result ) {
- return $this->newFromArray( $this->getFieldsFromDBResult( $result ) );
+ return self::newRowFromFromDBResult( $result );
}
/**
- * Get a new instance of the class from an array.
+ * Get a new instance of the class from a database result.
+ *
+ * @since 1.20
+ *
+ * @param stdClass $result
+ *
+ * @return IORMRow
+ */
+ public function newRowFromDBResult( stdClass $result ) {
+ return $this->newRow( $this->getFieldsFromDBResult( $result ) );
+ }
+
+ /**
+ * @see ORMTable::newRow
*
+ * @deprecated use newRow instead
* @since 1.20
*
* @param array $data
* @return IORMRow
*/
public function newFromArray( array $data, $loadDefaults = false ) {
+ return static::newRow( $data, $loadDefaults );
+ }
+
+ /**
+ * Get a new instance of the class from an array.
+ *
+ * @since 1.20
+ *
+ * @param array $data
+ * @param boolean $loadDefaults
+ *
+ * @return IORMRow
+ */
+ public function newRow( array $data, $loadDefaults = false ) {
$class = $this->getRowClass();
return new $class( $this, $data, $loadDefaults );
}