[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/db/ -> IORMRow.php (summary)

(no description)

File Size: 270 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

IORMRow:: (22 methods):
  loadFields()
  getField()
  loadAndGetField()
  removeField()
  getId()
  setId()
  hasField()
  hasIdField()
  setFields()
  toArray()
  loadDefaults()
  save()
  remove()
  getFields()
  getSetFieldNames()
  setField()
  addToField()
  getFieldNames()
  loadSummaryFields()
  setUpdateSummaries()
  setSummaryMode()
  getTable()


Interface: IORMRow  - X-Ref

Interface for representing objects that are stored in some DB table.
This is basically an ORM-like wrapper around rows in database tables that
aims to be both simple and very flexible. It is centered around an associative
array of fields and various methods to do common interaction with the database.

Documentation inline and at https://www.mediawiki.org/wiki/Manual:ORMTable

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
http://www.gnu.org/copyleft/gpl.html

loadFields( $fields = null, $override = true, $skipLoaded = false )   X-Ref
Load the specified fields from the database.

param: array|null $fields
param: bool $override
param: bool $skipLoaded
return: bool Success indicator

getField( $name, $default = null )   X-Ref
Gets the value of a field.

param: string $name
param: mixed $default
return: mixed

loadAndGetField( $name )   X-Ref
Gets the value of a field but first loads it if not done so already.

param: string $name
return: mixed

removeField( $name )   X-Ref
Remove a field.

param: string $name

getId()   X-Ref
Returns the objects database id.

return: int|null

setId( $id )   X-Ref
Sets the objects database id.

param: int|null $id

hasField( $name )   X-Ref
Gets if a certain field is set.

param: string $name
return: bool

hasIdField()   X-Ref
Gets if the id field is set.

return: bool

setFields( array $fields, $override = true )   X-Ref
Sets multiple fields.

param: array $fields The fields to set
param: bool $override Override already set fields with the provided values?

toArray( $fields = null, $incNullId = false )   X-Ref
Serializes the object to an associative array which
can then easily be converted into JSON or similar.

param: null|array $fields
param: bool $incNullId
return: array

loadDefaults( $override = true )   X-Ref
Load the default values, via getDefaults.

param: bool $override

save( $functionName = null )   X-Ref
Writes the answer to the database, either updating it
when it already exists, or inserting it when it doesn't.

param: string|null $functionName
return: bool Success indicator

remove()   X-Ref
Removes the object from the database.

return: bool Success indicator

getFields()   X-Ref
Return the names and values of the fields.

return: array

getSetFieldNames()   X-Ref
Return the names of the fields.

return: array

setField( $name, $value )   X-Ref
Sets the value of a field.
Strings can be provided for other types,
so this method can be called from unserialization handlers.

param: string $name
param: mixed $value

addToField( $field, $amount )   X-Ref
Add an amount (can be negative) to the specified field (needs to be numeric).

param: string $field
param: int $amount
return: bool Success indicator

getFieldNames()   X-Ref
Return the names of the fields.

return: array

loadSummaryFields( $summaryFields = null )   X-Ref
Computes and updates the values of the summary fields.

param: array|string|null $summaryFields

setUpdateSummaries( $update )   X-Ref
Sets the value for the @see $updateSummaries field.

param: bool $update

setSummaryMode( $summaryMode )   X-Ref
Sets the value for the @see $inSummaryMode field.

param: bool $summaryMode

getTable()   X-Ref
Returns the table this IORMRow is a row in.

return: IORMTable



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1