@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $this->logInWithPermission('MDO_Edit'); |
| 59 | 59 | $object = $this->objFromFixture(SampleManageableDataObject::class, 'one'); |
| 60 | - $response = $this->get('/SampleManageableObjectPage_Controller/edit/' . $object->ID); |
|
| 60 | + $response = $this->get('/SampleManageableObjectPage_Controller/edit/'.$object->ID); |
|
| 61 | 61 | $this->assertEquals(200, $response->getStatusCode()); |
| 62 | 62 | $this->logOut(); |
| 63 | 63 | |
| 64 | - $response2 = $this->get('/SampleManageableObjectPage_Controller/edit/' . 0); |
|
| 64 | + $response2 = $this->get('/SampleManageableObjectPage_Controller/edit/'.0); |
|
| 65 | 65 | $this->assertEquals(404, $response2->getStatusCode()); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $this->logInWithPermission('MDO_Delete'); |
| 80 | 80 | |
| 81 | - $response404 = $this->get('/SampleManageableObjectPage_Controller/delete/' . 0); |
|
| 81 | + $response404 = $this->get('/SampleManageableObjectPage_Controller/delete/'.0); |
|
| 82 | 82 | $this->assertEquals(404, $response404->getStatusCode()); |
| 83 | 83 | |
| 84 | - $success = $this->get('/SampleManageableObjectPage_Controller/delete/' . $id); |
|
| 84 | + $success = $this->get('/SampleManageableObjectPage_Controller/delete/'.$id); |
|
| 85 | 85 | $this->assertEquals(200, $success->getStatusCode()); |
| 86 | 86 | $this->assertNull(SampleManageableDataObject::get()->byID($id)); |
| 87 | 87 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $record = SampleManageableDataObject::get()->filter($data)->first(); |
| 108 | 108 | $this->assertInstanceOf(SampleManageableDataObject::class, $record); |
| 109 | - $this->assertTrue($record->exists());//*/ |
|
| 109 | + $this->assertTrue($record->exists()); //*/ |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | } |
| 113 | 113 | \ No newline at end of file |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return Security::permissionFailure( |
| 55 | - $this->owner, |
|
| 56 | - "You don't have permission to add records." |
|
| 57 | - ); |
|
| 55 | + $this->owner, |
|
| 56 | + "You don't have permission to add records." |
|
| 57 | + ); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | return Security::permissionFailure( |
| 81 | - $this->owner, |
|
| 82 | - "You don't have permission to edit this record." |
|
| 83 | - ); |
|
| 81 | + $this->owner, |
|
| 82 | + "You don't have permission to edit this record." |
|
| 83 | + ); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return $this->owner->httpError(404); |
@@ -105,9 +105,9 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return Security::permissionFailure( |
| 108 | - $this->owner, |
|
| 109 | - "You don't have permission to delete this record." |
|
| 110 | - ); |
|
| 108 | + $this->owner, |
|
| 109 | + "You don't have permission to delete this record." |
|
| 110 | + ); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | return $this->owner->httpError(404); |
@@ -144,18 +144,18 @@ discard block |
||
| 144 | 144 | return $form; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - /** |
|
| 148 | - * Save object |
|
| 149 | - * |
|
| 150 | - * @param $data |
|
| 151 | - * @param Form $form |
|
| 152 | - * |
|
| 153 | - * @return \SilverStripe\Control\HTTPResponse |
|
| 154 | - * @throws \SilverStripe\ORM\ValidationException |
|
| 155 | - */ |
|
| 147 | + /** |
|
| 148 | + * Save object |
|
| 149 | + * |
|
| 150 | + * @param $data |
|
| 151 | + * @param Form $form |
|
| 152 | + * |
|
| 153 | + * @return \SilverStripe\Control\HTTPResponse |
|
| 154 | + * @throws \SilverStripe\ORM\ValidationException |
|
| 155 | + */ |
|
| 156 | 156 | public function doSaveObject($data, Form $form) |
| 157 | 157 | { |
| 158 | - /** @var \SilverStripe\ORM\DataObject $model */ |
|
| 158 | + /** @var \SilverStripe\ORM\DataObject $model */ |
|
| 159 | 159 | $model = $this->owner->config()->get('managed_object'); |
| 160 | 160 | |
| 161 | 161 | /** @var \SilverStripe\ORM\DataObject|\Dynamic\ViewableDataObject\Extensions\ViewableDataObject $object */ |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $object = $model::create(); |
| 169 | 169 | if ($object->hasDatabaseField('URLSegment')) { |
| 170 | 170 | $object->URLSegment = Injector::inst()->create(SiteTree::class) |
| 171 | - ->generateURLSegment($data['Title']); |
|
| 171 | + ->generateURLSegment($data['Title']); |
|
| 172 | 172 | } |
| 173 | 173 | // write on create to relations are saved on final write (needs ID) |
| 174 | 174 | $object->write(); |
@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | if ($object->canCreate(Security::getCurrentUser())) { |
| 40 | 40 | |
| 41 | 41 | $form = $this->ManageableDataObjectForm(); |
| 42 | - if($object->config()->get('add_form_cancel_button')){ |
|
| 42 | + if ($object->config()->get('add_form_cancel_button')) { |
|
| 43 | 43 | $form->Actions()->push(new CancelFormAction($this->owner->Link(), 'Cancel')); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $this->owner->customise([ |
| 47 | 47 | 'Title' => ($this->owner->config()->get('add_item_title')) |
| 48 | 48 | ? $this->owner->config()->get('add_item_title') |
| 49 | - : 'Add new ' . $object->singular_name(), |
|
| 49 | + : 'Add new '.$object->singular_name(), |
|
| 50 | 50 | 'ManageableDataObjectForm' => $form, |
| 51 | 51 | ]); |
| 52 | 52 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $form = $this->ManageableDataObjectForm($item); |
| 72 | 72 | |
| 73 | 73 | return $this->owner->customise([ |
| 74 | - 'Title' => 'Edit ' . $item->singular_name(), |
|
| 74 | + 'Title' => 'Edit '.$item->singular_name(), |
|
| 75 | 75 | 'ManageableDataObjectForm' => $form, |
| 76 | 76 | 'Item' => $item, |
| 77 | 77 | ]); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $object = Injector::inst()->get($object); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - /** @var \SilverStripe\ORM\DataObject|\Dynamic\ManageableDataObject\Interfaces\ManageableDataObjectInterface $object */ |
|
| 29 | + /** @var \SilverStripe\ORM\DataObject|\Dynamic\ManageableDataObject\Interfaces\ManageableDataObjectInterface $object */ |
|
| 30 | 30 | $fields = $object->getFrontEndFields(); |
| 31 | 31 | $actions = $object->getFrontEndActions(); |
| 32 | 32 | if (!$actions->dataFieldByName('action_doSaveObject')) { |