Use 3.1 syntax for extension database fields

This commit is contained in:
Will Rossiter 2013-05-25 19:08:55 +12:00
parent 25f0c051ff
commit 2cdd3b5469

View File

@ -16,16 +16,13 @@
*/ */
class MultiFormObjectDecorator extends DataExtension { class MultiFormObjectDecorator extends DataExtension {
public function updateDBFields() { private static $db = array(
return array( 'MultiFormIsTemporary' => 'Boolean',
'db' => array( );
'MultiFormIsTemporary' => 'Boolean',
), private static $has_one = array(
'has_one' => array( 'MultiFormSession' => 'MultiFormSession',
'MultiFormSession' => 'MultiFormSession', );
)
);
}
public function augmentSQL(SQLQuery &$query) { public function augmentSQL(SQLQuery &$query) {
// If you're querying by ID, ignore the sub-site - this is a bit ugly... // If you're querying by ID, ignore the sub-site - this is a bit ugly...
@ -49,9 +46,11 @@ class MultiFormObjectDecorator extends DataExtension {
*/ */
protected function wantsTemporary($query) { protected function wantsTemporary($query) {
foreach($query->where as $whereClause) { foreach($query->where as $whereClause) {
if($whereClause == "\"{$query->from[0]}\".\"MultiFormIsTemporary\" = 1") return true; if($whereClause == "\"{$query->from[0]}\".\"MultiFormIsTemporary\" = 1") {
return true;
}
} }
return false; return false;
} }
} }