Skip to content

Commit

Permalink
Clean up files
Browse files Browse the repository at this point in the history
  • Loading branch information
doishub committed May 5, 2020
1 parent ae3f6ea commit 5faf791
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"license":"MIT",
"authors":[
{
"name":"Oveleon",
"homepage":"https://oveleon.de/",
"name":"Daniele Sciannimanica",
"homepage":"https://github.com/doishub",
"role":"Developer"
}
],
Expand Down
12 changes: 8 additions & 4 deletions src/Resources/contao/classes/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@

namespace ContaoEstateManager\ObjectTypeEntity;

class ObjectType extends \Backend
use Contao\Backend;
use Contao\DataContainer;
use Contao\StringUtil;

class ObjectType extends Backend
{

/**
* Save connection from save callback
*
* @param $varValue
* @param \DataContainer $dc
* @param DataContainer $dc
*
* @return string
*/
public function objectTypeConnectionSaveCallback($varValue, \DataContainer $dc)
public function objectTypeConnectionSaveCallback($varValue, DataContainer $dc)
{
$arrObjectTypes = \StringUtil::deserialize($varValue);
$arrObjectTypes = StringUtil::deserialize($varValue);

// delete previous connections
ObjectTypeConnectionModel::deleteByPidAndPtable($dc->activeRecord->id, $dc->table);
Expand Down
7 changes: 5 additions & 2 deletions src/Resources/contao/models/ObjectTypeConnectionModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace ContaoEstateManager\ObjectTypeEntity;

use Contao\Database;
use Contao\Model;

/**
* Reads and writes object type connections
*
Expand All @@ -23,7 +26,7 @@
*
* @author Daniele Sciannimanica <https://github.com/doishub>
*/
class ObjectTypeConnectionModel extends \Model
class ObjectTypeConnectionModel extends Model
{

/**
Expand All @@ -42,7 +45,7 @@ public static function deleteByPidAndPtable($pid, $ptable)
{
$strTable = static::$strTable;

$objDatabase = \Database::getInstance();
$objDatabase = Database::getInstance();
$objDatabase->prepare('DELETE FROM ' . $strTable . ' WHERE pid=' . $pid . ' AND ptable="' . $ptable . '"')->execute();
}
}
4 changes: 3 additions & 1 deletion src/Resources/contao/models/ObjectTypeModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace ContaoEstateManager\ObjectTypeEntity;

use Contao\Model;

/**
* Reads and writes object types
*
Expand Down Expand Up @@ -31,7 +33,7 @@
*
* @author Daniele Sciannimanica <https://github.com/doishub>
*/
class ObjectTypeModel extends \Model
class ObjectTypeModel extends Model
{

/**
Expand Down

0 comments on commit 5faf791

Please sign in to comment.