@Danny - There are not (yet) many developers working on xPDO other than myself and with my obligations to MODx, xPDO, and my day job, the documentation has yet to be fully fleshed out. I’ll do my best to guide you and perhaps this will help produce some good content for the documentation.
Quote from: Danny at Jan 10, 2008, 02:55 PM
- how can I specify the primary key for my table ? (it seems that I can’t delete a row without a PK)
Did you create an XML schema of your model using the reverse-engineering facilities or manually? There is not a lot of documentation on that, but you can see a great example of a schema at
http://svn.xpdo.org/crucible/browse/~raw,r=38/xpdo/trunk/model/schema/sample.mysql.schema.xml, or a more advanced one is available at
http://svn.modxcms.com/crucible/browse/~raw,r=3272/MODx/branches/0.9.7/core/model/schema/modx.mysql.schema.xml.
Regardless, you can easily specify the pk with the attribute
index="pk", though you’ll also want to use
generated="native" to indicate that you want to use a MySQL auto-increment key. If your object extends xPDOSimpleObject, you already have a pk column with the fieldname of
id.
Quote from: Danny at Jan 10, 2008, 02:55 PM
- how can I retrieve a set of rows ? (getObject() only returns one row)
You use xPDO::getCollection() or xPDO::getCollectionGraph() to return row collections. xPDO::getObject() and xPDO::getObjectGraph() are used for returning a single row only.