Hi All,
This is probably something really simple that I am missing here.
Basically building an item management system for frontend users to manage their own items. I have everything working fine except for one thing and I am sure it is something really simple that I just haven't found yet.
Essentially what I am asking is, is there a way to push a new column of data onto each row in a return DataObjectSet
So for example if I had FirstName (Colin) and Surname (Burns) and I wanted to create a new column called NickName which I created by the first letter of the FirstName and the Surname (cburns). I want know how to create this column in the logic and push it onto my DataObjectSet.
N.B: There is probably a way to do this specific example in the template, but that's not what i am looking for. I've deliberately tried to use a really simple example as a demonstration.
if(!isset($_GET['start']) || !is_numeric($_GET['start']) || (int)$_GET['start'] < 1) $_GET['start'] = 0;
$SQL_start = (int)$_GET['start'];
$AllItems = DataObject::get(
$callerClass = $thisClassName, // enter the Object type (e.g. 'MyPageType')
$filter = "ItemType = 'want' AND Status = '{$thisStatus}' AND MemberID = '".Member::currentUserID()."'",
$sort = "Created DESC, Value DESC",
$join = "",
$limit = "{$SQL_start}, $itemsPerPage" // enter the number of items per page (int)
);
// So I guess in here I would need to loop through the DataObjectSet using two of the fields in it to create a new field and then push it onto the DataObjectSet
return $this->customise(array('AllItems' => $AllItems))->renderWith('ajax_ListManagement_All');
Any suggestions would be grand :)
Cheers,
Colin