User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This pull request introduces a new utility method to the Joomla\CMS\Table\Table class:
getData() – returns the data of the current table record as an associative array. It is needed because developers currently lack a simple and consistent way to retrieve all field values from a Table object. They have to use workarounds such as ArrayHelper::fromObject, get_object_vars or CMSHelper getRowData, CMSHelper getDataObject. Having this method will make make it easier to receive the data from Table object.As this is a new method, I do not really know how to give testing instructions. Maybe it would require maintainer code review?
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
Feature
PR-6.1-dev
|
||
| Title |
|
||||||
I have tested this item ✅ successfully on 4c71726
Using a known component i added a second line with getData and compared the result with get_object_vars. See below.
Result:
Note
Attention: Manually added table items were missing. So 'getData' and 'get_object_vars' may differ in results
// Convert to \stdClass before adding other data
$properties = get_object_vars($table);
$propertiesB = $table->getData();
I have tested this item ✅ successfully on 4c71726
I have test this Applied Commit SHA: 4c71726
The getData() method has been correctly implemented in libraries/src/Table/Table.php and its behavior matches the requirements.
One small observation: the method is currently not part of TableInterface.php, which might be a good addition for complete consistency. Otherwise, the implementation is solid.
You can review the details in the
I have tested this item ✅ successfully on 4c71726
| Status | Pending | ⇒ | Ready to Commit |
RTC
@joomdonation
To keep the form, the testing instructions may include a example how to use the code and check the expected result. Then someone may follow it up ...
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46534.