mirror of
https://github.com/Karaka-Management/oms-ProjectManagement.git
synced 2026-02-12 05:48:40 +00:00
Making datamapper static
This commit is contained in:
parent
478c0cf2e5
commit
ddb4ccc620
|
|
@ -101,12 +101,12 @@ class ProjectMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function create($obj)
|
public static function create($obj, bool $relations = true)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$objId = parent::create($obj);
|
$objId = parent::create($obj, $relations);
|
||||||
$query = new Builder($this->db);
|
$query = new Builder(self::$db);
|
||||||
$query->prefix($this->db->getPrefix())
|
$query->prefix(self::$db->getPrefix())
|
||||||
->insert(
|
->insert(
|
||||||
'account_permission_account',
|
'account_permission_account',
|
||||||
'account_permission_from',
|
'account_permission_from',
|
||||||
|
|
@ -122,7 +122,7 @@ class ProjectMapper extends DataMapperAbstract
|
||||||
->into('account_permission')
|
->into('account_permission')
|
||||||
->values($obj->getCreatedBy(), 'calendar_project', 'calendar_project', 1, $objId, 1, 1, 1, 1, 1);
|
->values($obj->getCreatedBy(), 'calendar_project', 'calendar_project', 1, $objId, 1, 1, 1, 1, 1);
|
||||||
|
|
||||||
$this->db->con->prepare($query->toSql())->execute();
|
self::$db->con->prepare($query->toSql())->execute();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
var_dump($e->getMessage());
|
var_dump($e->getMessage());
|
||||||
|
|
||||||
|
|
@ -142,7 +142,7 @@ class ProjectMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function find(...$columns) : Builder
|
public static function find(...$columns) : Builder
|
||||||
{
|
{
|
||||||
return parent::find(...$columns)->from('account_permission')
|
return parent::find(...$columns)->from('account_permission')
|
||||||
->where('account_permission.account_permission_for', '=', 'calendar_project')
|
->where('account_permission.account_permission_for', '=', 'calendar_project')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user