Seeking Flex-Objects CRUD tutorial (PHP)

Where can I find online PHP code snippets (e.g. a tutorial) for performing various CRUD operations on a flex-object “record”?
Bonus points if the tutorial also addresses how to “join” 2 flex-objects and query the result.
Thanks in advance.

@boatful, Did you have a chance to read the docs on Flex Objects and try the demo using ‘Contacts’?

Bonus points if the tutorial also addresses how to “join” 2 flex-objects and query the result.

You’re using RDMS terminology, but Flex Objects is not some kind of relational database…

Let’s focus on PHP/CRUD syntax.

  1. How (in php) does one lookup a single item/record in a flex collection and then a) update or b) delete that item/record?
  2. How (in php) does one create a unique/new item in a flex collection?

The PayPal IPN listener I’m building needs these capabilities and I’m looking for PHP code snippets to point the way.

Thanks.

@boatful, Let’s focus on my previous question first: :slight_smile:

Did you have a chance to read the docs on Flex Objects and the demo using ‘Contacts’?

And I would like to add: Did you have a chance to search this forum?

The PayPal IPN listener I’m building needs these capabilities

Does this really need to be implemented in Flex? Do you have (tens of) thousands of objects to manage?

1 Like

@pamtbaau is there an alternative to Flex Objects for simpler structures? I want a structured and standard way to interact with data in my back-end, and an API (with a custom Plugin) to define relationships between the data, is there a simpler way to do it, other than Flex Objects?

@CuriousCI, If your “simpler structures” can be stored as Yaml or Json and you don’t need thousands of objects, then a simple flat file would probably suffice.

and an API (with a custom Plugin) to define relationships between the data

That sounds like a feature of a relational database, which flat files and Flex are not. However, you can use an RDBMS.

1 Like

The README.md file for the GRAV Flex Objects Plugin states, in part: “…both objects and collections can be customized by PHP classes, which allows you to define complex behaviors and relationships between the objects.”

This suggests to me that one-to-one and/or many-to-one relationships could be defined and employed for 2 related collections or objects. Could (for example) the unique username for persons in the user/accounts collection by used to link to data stored in a separate DIY user/phones collection (a potentially many-to-one relationship)?

I am afraid to alter the OEM blueprint for the user/accounts collection itself, afraid that any future updates to the GRAV login plugin could wipe out the OEM blueprint I took it upon myself to customize.