Ok cool - I’ll give it a whirl and see what happens!
Hey guys, is it possible to extend a data object and merge the static $db property? Use case is I want a new data object based off a parent one with a few changes. I don’t want to use extensions as I need the two objects to be distinct. Is this possible in SS?
@josh has joined the channel
Your approach is cleaner though.
Yeah cool, I just tried this and it worked fine:
- public function index()
- // Get 9 random projects
- $projects = ;
- $projects_datalist = $this->getRandomProjects(9);
- foreach ($projects_datalist as $project)
- $projects = $project;
- return array(
- 'projects' => new ArrayList($projects)
Right, can you show me how to do that?
Yeah that’s what I thought might’ve been happening. Oh well, thanks for your help, I’ll have a go at getting around that.
SS docs, one sec I’ll post the link.
No, but still the same outcome after a
?flush. Yeah I come from other frameworks, so perhaps I’m missing something obvious SilverStripe specific!