# It's okay to autoblock. Go ahead and create/insert the block.
- $ipblock = Block::newFromDB( $autoblockIP );
+ $ipblock = Block::newFromTarget( $autoblockIP );
if ( $ipblock ) {
# If the user is already blocked. Then check if the autoblock would
# exceed the user block. If it would exceed, then do nothing, else
* @param $table String: table name
* @param $vars String: the selected variables
* @param $conds Array: a condition map, terms are ANDed together.
- * Items with numeric keys are taken to be literal conditions
- * Takes an array of selected variables, and a condition map, which is ANDed
- * e.g: selectRow( "page", array( "page_id" ), array( "page_namespace" =>
- * NS_MAIN, "page_title" => "Astronomy" ) ) would return an object where
- * $obj- >page_id is the ID of the Astronomy article
+ * Items with numeric keys are taken to be literal conditions
+ * Takes an array of selected variables, and a condition map, which is ANDed
+ * e.g: selectRow( "page", array( "page_id" ), array( "page_namespace" =>
+ * NS_MAIN, "page_title" => "Astronomy" ) ) would return an object where
+ * $obj- >page_id is the ID of the Astronomy article
* @param $fname String: Calling function name
* @param $options Array
* @param $join_conds Array
*
- * @todo migrate documentation to phpdocumentor format
+ * @return ResultWrapper|Bool
*/
function selectRow( $table, $vars, $conds, $fname = 'DatabaseBase::selectRow', $options = array(), $join_conds = array() ) {
$options['LIMIT'] = 1;
* Fields can be retrieved with $row->fieldname, with fields acting like
* member variables.
*
- * @return MySQL row object
+ * @return object
* @throws DBUnexpectedError Thrown if the database returns an error
*/
function fetchObject() {
* Fetch the next row from the given result object, in associative array
* form. Fields are retrieved with $row['fieldname'].
*
- * @return MySQL row object
+ * @return Array
* @throws DBUnexpectedError Thrown if the database returns an error
*/
function fetchRow() {
function testInitializerFunctionsReturnCorrectBlock() {
- $this->assertTrue( $this->block->equals( Block::newFromDB('UTBlockee') ), "newFromDB() returns the same block as the one that was made");
+ $this->assertTrue( $this->block->equals( Block::newFromTarget('UTBlockee') ), "newFromTarget() returns the same block as the one that was made");
$this->assertTrue( $this->block->equals( Block::newFromID( 1 ) ), "newFromID() returns the same block as the one that was made");