Questions tagged [xpdo]

OpenExpedio is our name for open extensions to PDO. It's a light-weight ORB library that takes advantage of the newly adopted standard for database persistence in PHP 5.1+, PDO.

About the OpenExpedio Project

OpenExpedio is our name for open eXtensions to PDO. It's a light-weight ORB (object-relational bridge) library that works on PHP 4 and 5, and takes advantage of the newly adopted standard for database persistence in PHP 5.1+, PDO. It implements the very simple, but effective Active Record pattern for data access.

But OpenExpedio is a little more than a simple pattern implementation. It's a PDO implementation for PHP 4 and 5.0.x (where native PDO extensions are not available), a way to abstract business objects from the actual SQL queries and prepared statements used to access a relational database structure representing them, and a way to easily describe and provide optimized implementations of an object model for multiple target database platforms.

Object/Relational Persistence Framework

OpenExpedio is not a query abstraction tool, so the generated classes and maps are targeted at a specific platform to get you started. You just add your own methods and SQL to the generated classes to implement your application-specific business logic. XPDO was inspired by the need to provide an object-oriented API for a web application that is easy to develop with and maintain, and could be optimized as much as possible for the database platform it was being deployed on. And it needed to provide this with as small a code footprint as possible. For this reason, it specifically avoids the approaches of parsing and/or generating platform agnostic SQL that often doesn't take advantage of important performance-related features on each platform, or of relying on proprietary query expression languages that often generate unoptimized SQL in favor of supporting more platforms.

What is an ORB?

I refer to xPDO as an Object Relational Bridge, or ORB for short, because I like it better than the more popular ORM acronym, which stands for Object/Relational Mapping, and the more concise OPF, or Object Persistence Framework, just doesn't sound as good as ORB does. It has been adopted previously by several other projects including the Apache OJB project for J2EE, and now Modeling for Python (inspired by NeXT Software Inc.'s Enterprise Object Framework).

(source)

21 questions
0
votes
1 answer

Modx xPDO getMany not returning expected results

I'm not sure what is going on here, but I'm trying to retrieve some budgets from a modx/xpdo object and getting unexpected results. From the code below, both foreach loops return the same results [that of the first getMany call. 2 items] if I switch…
Sean Kimball
  • 4,506
  • 9
  • 42
  • 73
0
votes
1 answer

What is the correct syntax for CONCAT in modx xpdo statement

I'm trying to deal with spaces in a search tool - specifically for dealing with first and last names, I can get my queries to work on the command line, but when I try to convert them to the modx/pdo syntax I'm not getting results. [because the…
Sean Kimball
  • 4,506
  • 9
  • 42
  • 73
0
votes
3 answers

Modx Plugin: Set createdby of Resource to Match TV Value

I am trying to create a plugin that will take the value of a listbox TV and set the document's createdby field to match that TV's setting onDocFormSave. The TV populates itself automatically with all active users and output's their ID. I have the…
Benjamin Morrison
  • 783
  • 2
  • 8
  • 22
0
votes
3 answers

xPDO compiles integer as string

$query = $this->modx->newQuery('modResource'); $query->leftJoin('modTemplateVarResource', "price", array("modResource.id = price.contentid", "price.tmplvarid = 2")); $query->where(array("price:>=" => 6000)); $query->prepare(); echo…
YanAlex
  • 99
  • 1
  • 10
0
votes
3 answers

Can't create and reference Model in Modx

I have produced a really simple code sample. This was not added as a NameSpace into Modx. Start with a blank Modx install. Create scheme file:
James
  • 3,265
  • 4
  • 22
  • 28
-1
votes
1 answer

Object sort order is wrong

I'm trying to figure out what is wrong with the sort order on an xPDO SQL query, This query $criteria = $this->modx->newQuery($table); $criteria->sortby($sortby,$sortdir); $options =…
Sean Kimball
  • 4,506
  • 9
  • 42
  • 73
1
2