mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
Use 3.1 syntax for extension database fields
This commit is contained in:
parent
25f0c051ff
commit
2cdd3b5469
@ -16,16 +16,13 @@
|
||||
*/
|
||||
class MultiFormObjectDecorator extends DataExtension {
|
||||
|
||||
public function updateDBFields() {
|
||||
return array(
|
||||
'db' => array(
|
||||
'MultiFormIsTemporary' => 'Boolean',
|
||||
),
|
||||
'has_one' => array(
|
||||
'MultiFormSession' => 'MultiFormSession',
|
||||
)
|
||||
);
|
||||
}
|
||||
private static $db = array(
|
||||
'MultiFormIsTemporary' => 'Boolean',
|
||||
);
|
||||
|
||||
private static $has_one = array(
|
||||
'MultiFormSession' => 'MultiFormSession',
|
||||
);
|
||||
|
||||
public function augmentSQL(SQLQuery &$query) {
|
||||
// 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) {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user