Documentation insufficient, getting single Express Entry

I’m trying to programmatically update a single Express Entry, however the documentation ( Creating, Reading, Searching, Updating and Deleting Express Entries :: Concrete CMS ) is not sufficiently clear.

Under the “Retrieving Entries” section, it explains…

$entity = Express::getObjectByHandle('student');
$list = new Concrete\Core\Express\EntryList($entity);
$students = $list->getResults();

Okay so I have $students which is a list of Entries for Express Object “student”.

However, I scroll down, a touch below to the “Getting an Entry by Its ID”

“Need to retrieve an entry by its ID? It’s simple:”

$student = Express::getEntry(1);

Except… I don’t see how I have the SINGULAR $student variable, how that came to be, or even how this “Express::getEntry(1)” function knew WHICH Express Object to get the Entry from.

Does $students (plural) being created magically also create a hidden $student (singular) variable/object… simply because $students has an “s” at the end of it and it becomes plural? Or Is there something else I need to do?

I genuinely cannot tell how to ONLY create a php Variable Object with a singular Express Entry in it. Like there’s times I just want to update one Entry without having to create a list. But do I need to make a list? I honestly can’t tell.

And I can’t find anywhere else on the internet that clarifies on this.

While I do want to know how to do this “correctly”, I also think this area of the documentation should be corrected to be explicit and clear @andrew .

Can anyone advise on the actual use of this? As so far… I’m not successful with this.

All Express entries are just stored in one table and Concrete will know which object to return (based on provided id).
If you start adding entries in Dashboard, you will notice id is always incremented by 1, whatever type of entry you add.
Hence the general syntax of Express::getEntry(1).

1 in getEntry() is just arbitrary number. It is assumed you followed previous example and added student entry as first one. If you would create another object/add its entry first, then it would return object different than student.

So all Express Entries, in the entire installation of Concrete CMS are serialised in a global list?
And ->getId() gets the global ID for that Express Entry?

Yeah, something like that. That’s Express “gimmick” (in most frameworks you would probably have separate classes for each entity/model, whatever you call it).

1 Like