API-CHANGE: removing protected object_to_array method (use get_object_vars instead)

This commit is contained in:
Julian Seidenberg 2011-03-25 18:02:24 +13:00 committed by Ingo Schommer
parent 5ea4615d4d
commit eaa6c6c49d
2 changed files with 0 additions and 29 deletions

View File

@ -89,18 +89,6 @@ class ArrayData extends ViewableData {
return isset($this->array[$f]); return isset($this->array[$f]);
} }
/**
* @deprecated Use get_object_vars($obj)
* Converts an object with simple properties to
* an associative array.
*
* @param obj $obj
* @return array
*/
protected static function object_to_array($obj) {
return get_object_vars($obj);
}
/** /**
* Converts an associative array to a simple object * Converts an associative array to a simple object
* *

View File

@ -67,15 +67,6 @@ class ArrayDataTest extends SapphireTest {
$this->assertEquals("array (\n 'b' => 'bunny',\n)", $arrayData->forTemplate()); $this->assertEquals("array (\n 'b' => 'bunny',\n)", $arrayData->forTemplate());
} }
function testObjectToArrayWorks() {
$object = new ArrayDataTest_NonEmptyObject();
$array = ArrayDataTest_ArrayData_Exposed::object_to_array($object);
$this->assertEquals("Apple", $array['a']);
$this->assertEquals("Banana", $array['b']);
}
function testSetField() { function testSetField() {
$arrayData = new ArrayData(array()); $arrayData = new ArrayData(array());
@ -108,14 +99,6 @@ class ArrayDataTest extends SapphireTest {
} }
class ArrayDataTest_ArrayData_Exposed extends ArrayData {
public static function object_to_array($obj) {
return parent::object_to_array($obj);
}
}
class ArrayDataTest_NonEmptyObject { class ArrayDataTest_NonEmptyObject {
static $c = "Cucumber"; static $c = "Cucumber";