Skip to content

Commit d08fc34

Browse files
committed
- (API) Refactored Postmaster_ServiceSettingsModel to be a bare bones extendible model without any logic. (Logic moved to the Postmaster_BaseSettingsModel)
1 parent 86d3478 commit d08fc34

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

models/Postmaster_ServiceSettingsModel.php

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,8 @@
11
<?php
22
namespace Craft;
33

4-
use Craft\Plugins\Postmaster\Interfaces\ParseInterface;
5-
6-
class Postmaster_ServiceSettingsModel extends BaseModel implements ParseInterface
4+
class Postmaster_ServiceSettingsModel extends Postmaster_BaseSettingsModel
75
{
8-
public function parse(Array $data = array())
9-
{
10-
$this->setAttributes($this->parseArray($this->getAttributes(), $data));
11-
12-
return $this;
13-
}
14-
15-
public function render($value, Array $data = array())
16-
{
17-
return craft()->templates->renderString($value, $data);
18-
}
19-
20-
public function parseArray($subject, Array $data = array())
21-
{
22-
if(is_string($subject) && !empty($subject))
23-
{
24-
$subject = $this->render($subject, $data);
25-
}
26-
else if(is_array($subject) || is_object($subject))
27-
{
28-
foreach($subject as $index => $value)
29-
{
30-
$subject[$index] = $this->parseArray($value, $data);
31-
}
32-
}
33-
34-
return $subject;
35-
}
36-
376
protected function defineAttributes()
387
{
398
return array();

0 commit comments

Comments
 (0)