*/
class ORMRow implements IORMRow {
-
/**
* The fields of the object.
* field name (w/o prefix) => value
* Settings this to false can prevent needless updating work in situations
* such as deleting a university, which will then delete all it's courses.
*
- * @deprecated since 1.21
+ * @deprecated since 1.22
* @since 1.20
* @var bool
*/
* This mode indicates that only summary fields got updated,
* which allows for optimizations.
*
- * @deprecated since 1.21
+ * @deprecated since 1.22
* @since 1.20
* @var bool
*/
protected $inSummaryMode = false;
/**
- * @deprecated since 1.21
+ * @deprecated since 1.22
* @since 1.20
* @var ORMTable|null
*/
*
* @since 1.20
*
- * @param IORMTable|null $table Deprecated since 1.21
+ * @param IORMTable|null $table Deprecated since 1.22
* @param array|null $fields
- * @param boolean $loadDefaults Deprecated since 1.21
+ * @param boolean $loadDefaults Deprecated since 1.22
*/
public function __construct( IORMTable $table = null, $fields = null, $loadDefaults = false ) {
$this->table = $table;
* Load the specified fields from the database.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @param array|null $fields
* @param boolean $override
if ( $result !== false ) {
$this->setFields( $this->table->getFieldsFromDBResult( $result ), $override );
+
return true;
}
+
return false;
}
* Gets the value of a field but first loads it if not done so already.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @param $name string
*
* @return boolean
*/
public function hasIdField() {
- return $this->hasField( 'id' )
- && !is_null( $this->getField( 'id' ) );
+ return $this->hasField( 'id' ) && !is_null( $this->getField( 'id' ) );
}
/**
* Gets the fields => values to write to the table.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @return array
*/
$value = $this->fields[$name];
// Skip null id fields so that the DBMS can set the default.
- if ( $name === 'id' && is_null ( $value ) ) {
+ if ( $name === 'id' && is_null( $value ) ) {
continue;
}
* Load the default values, via getDefaults.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @param boolean $override
*/
* when it already exists, or inserting it when it doesn't.
*
* @since 1.20
- * @deprecated since 1.21 Use IORMTable->updateRow or ->insertRow
+ * @deprecated since 1.22 Use IORMTable->updateRow or ->insertRow
*
* @param string|null $functionName
*
* Updates the object in the database.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @param string|null $functionName
*
* Inserts the object into the database.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @param string|null $functionName
* @param array|null $options
* Removes the object from the database.
*
* @since 1.20
- * @deprecated since 1.21, use IROMtable->removeRow
+ * @deprecated since 1.22, use IORMTable->removeRow
*
* @return boolean Success indicator
*/
* Gets called before an object is removed from the database.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*/
protected function beforeRemove() {
$this->loadFields( $this->getBeforeRemoveFields(), false, true );
/**
* Before removal of an object happens, @see beforeRemove gets called.
- * This method loads the fields of which the names have been returned by this one (or all fields if null is returned).
- * This allows for loading info needed after removal to get rid of linked data and the like.
+ * This method loads the fields of which the names have been returned by
+ * this one (or all fields if null is returned). This allows for loading
+ * info needed after removal to get rid of linked data and the like.
*
* @since 1.20
*
* Can be overridden to get rid of linked data.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*/
protected function onRemoved() {
$this->setField( 'id', null );
* Add an amount (can be negative) to the specified field (needs to be numeric).
*
* @since 1.20
- * @deprecated since 1.21, use IORMTable->addToField
+ * @deprecated since 1.22, use IORMTable->addToField
*
* @param string $field
* @param integer $amount
* Return the names of the fields.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @return array
*/
* Computes and updates the values of the summary fields.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @param array|string|null $summaryFields
*/
public function loadSummaryFields( $summaryFields = null ) {
-
}
/**
* Sets the value for the @see $updateSummaries field.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @param boolean $update
*/
* Sets the value for the @see $inSummaryMode field.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @param boolean $summaryMode
*/
* Returns the table this IORMRow is a row in.
*
* @since 1.20
- * @deprecated since 1.21
+ * @deprecated since 1.22
*
* @return IORMTable
*/
public function getTable() {
return $this->table;
}
-
}