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 {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user