Browse Source

generated code

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
43df2591df
28 changed files with 845 additions and 1 deletions
  1. 7
    1
      generate.php
  2. 14
    0
      src/Auth/Business/LuticateGroupsBusiness.php
  3. 14
    0
      src/Auth/Business/LuticatePermissionsBusiness.php
  4. 14
    0
      src/Auth/Business/LuticatePermissionsGroupsBusiness.php
  5. 14
    0
      src/Auth/Business/LuticatePermissionsUsersBusiness.php
  6. 14
    0
      src/Auth/Business/LuticateUsersBusiness.php
  7. 47
    0
      src/Auth/DBO/LuticateGroupsDbo.php
  8. 47
    0
      src/Auth/DBO/LuticatePermissionsDbo.php
  9. 61
    0
      src/Auth/DBO/LuticatePermissionsGroupsDbo.php
  10. 61
    0
      src/Auth/DBO/LuticatePermissionsUsersDbo.php
  11. 89
    0
      src/Auth/DBO/LuticateUsersDbo.php
  12. 15
    0
      src/Auth/DataAccess/LuticateGroupsDataAccess.php
  13. 15
    0
      src/Auth/DataAccess/LuticatePermissionsDataAccess.php
  14. 15
    0
      src/Auth/DataAccess/LuticatePermissionsGroupsDataAccess.php
  15. 15
    0
      src/Auth/DataAccess/LuticatePermissionsUsersDataAccess.php
  16. 15
    0
      src/Auth/DataAccess/LuticateUsersDataAccess.php
  17. 9
    0
      src/Auth/DataAccess/Models/LuticateGroups.php
  18. 49
    0
      src/Auth/DataAccess/Models/LuticateGroupsModel.php
  19. 9
    0
      src/Auth/DataAccess/Models/LuticatePermissions.php
  20. 9
    0
      src/Auth/DataAccess/Models/LuticatePermissionsGroups.php
  21. 51
    0
      src/Auth/DataAccess/Models/LuticatePermissionsGroupsModel.php
  22. 49
    0
      src/Auth/DataAccess/Models/LuticatePermissionsModel.php
  23. 9
    0
      src/Auth/DataAccess/Models/LuticatePermissionsUsers.php
  24. 51
    0
      src/Auth/DataAccess/Models/LuticatePermissionsUsersModel.php
  25. 9
    0
      src/Auth/DataAccess/Models/LuticateUsers.php
  26. 55
    0
      src/Auth/DataAccess/Models/LuticateUsersModel.php
  27. 44
    0
      src/Auth/DataAccess/SP/SpLuGetUserPermission.php
  28. 44
    0
      src/Auth/DataAccess/SP/SpLuRemovePermission.php

+ 7
- 1
generate.php View File

@@ -40,6 +40,12 @@ $gen->setConfig(array("dbo" =>
40 40
             "namespace" => 'Luticate\Auth\Business',
41 41
             "folder" => 'src/Auth/Business'
42 42
         ),
43
-    "mode" => 0775
43
+    "mode" => 0775,
44
+    "ignore" => array(
45
+        "tables" => array(
46
+            "/luticate_users_groups/"
47
+        ),
48
+        "sp" => array()
49
+    )
44 50
 ));
45 51
 $gen->run();

+ 14
- 0
src/Auth/Business/LuticateGroupsBusiness.php View File

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\Business;
4
+
5
+use Luticate\Utils\LuBusiness;
6
+use Luticate\Auth\DataAccess\LuticateGroupsDataAccess;
7
+use Luticate\Auth\DBO\LuticateGroupsDbo;
8
+
9
+class LuticateGroupsBusiness extends LuBusiness {
10
+    public function __construct()
11
+    {
12
+        $this->dataAccess = new LuticateGroupsDataAccess();
13
+    }
14
+}

+ 14
- 0
src/Auth/Business/LuticatePermissionsBusiness.php View File

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\Business;
4
+
5
+use Luticate\Utils\LuBusiness;
6
+use Luticate\Auth\DataAccess\LuticatePermissionsDataAccess;
7
+use Luticate\Auth\DBO\LuticatePermissionsDbo;
8
+
9
+class LuticatePermissionsBusiness extends LuBusiness {
10
+    public function __construct()
11
+    {
12
+        $this->dataAccess = new LuticatePermissionsDataAccess();
13
+    }
14
+}

+ 14
- 0
src/Auth/Business/LuticatePermissionsGroupsBusiness.php View File

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\Business;
4
+
5
+use Luticate\Utils\LuBusiness;
6
+use Luticate\Auth\DataAccess\LuticatePermissionsGroupsDataAccess;
7
+use Luticate\Auth\DBO\LuticatePermissionsGroupsDbo;
8
+
9
+class LuticatePermissionsGroupsBusiness extends LuBusiness {
10
+    public function __construct()
11
+    {
12
+        $this->dataAccess = new LuticatePermissionsGroupsDataAccess();
13
+    }
14
+}

+ 14
- 0
src/Auth/Business/LuticatePermissionsUsersBusiness.php View File

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\Business;
4
+
5
+use Luticate\Utils\LuBusiness;
6
+use Luticate\Auth\DataAccess\LuticatePermissionsUsersDataAccess;
7
+use Luticate\Auth\DBO\LuticatePermissionsUsersDbo;
8
+
9
+class LuticatePermissionsUsersBusiness extends LuBusiness {
10
+    public function __construct()
11
+    {
12
+        $this->dataAccess = new LuticatePermissionsUsersDataAccess();
13
+    }
14
+}

+ 14
- 0
src/Auth/Business/LuticateUsersBusiness.php View File

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\Business;
4
+
5
+use Luticate\Utils\LuBusiness;
6
+use Luticate\Auth\DataAccess\LuticateUsersDataAccess;
7
+use Luticate\Auth\DBO\LuticateUsersDbo;
8
+
9
+class LuticateUsersBusiness extends LuBusiness {
10
+    public function __construct()
11
+    {
12
+        $this->dataAccess = new LuticateUsersDataAccess();
13
+    }
14
+}

+ 47
- 0
src/Auth/DBO/LuticateGroupsDbo.php View File

@@ -0,0 +1,47 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ */
7
+
8
+namespace Luticate\Auth\DBO;
9
+
10
+use Luticate\Utils\LuDbo;
11
+
12
+class LuticateGroupsDbo extends LuDbo {
13
+
14
+    public function jsonSerialize()
15
+    {
16
+        return array(
17
+            "Id" => $this->_id,
18
+            "Name" => $this->_name
19
+        );
20
+    }
21
+
22
+    /**
23
+     * @var integer
24
+     */
25
+    protected $_id;
26
+    public function getId()
27
+    {
28
+        return $this->_id;
29
+    }
30
+    public function setId($value)
31
+    {
32
+        $this->_id = $value;
33
+    }
34
+
35
+    /**
36
+     * @var string
37
+     */
38
+    protected $_name;
39
+    public function getName()
40
+    {
41
+        return $this->_name;
42
+    }
43
+    public function setName($value)
44
+    {
45
+        $this->_name = $value;
46
+    }
47
+}

+ 47
- 0
src/Auth/DBO/LuticatePermissionsDbo.php View File

@@ -0,0 +1,47 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ */
7
+
8
+namespace Luticate\Auth\DBO;
9
+
10
+use Luticate\Utils\LuDbo;
11
+
12
+class LuticatePermissionsDbo extends LuDbo {
13
+
14
+    public function jsonSerialize()
15
+    {
16
+        return array(
17
+            "Name" => $this->_name,
18
+            "Value" => $this->_value
19
+        );
20
+    }
21
+
22
+    /**
23
+     * @var string
24
+     */
25
+    protected $_name;
26
+    public function getName()
27
+    {
28
+        return $this->_name;
29
+    }
30
+    public function setName($value)
31
+    {
32
+        $this->_name = $value;
33
+    }
34
+
35
+    /**
36
+     * @var boolean
37
+     */
38
+    protected $_value;
39
+    public function getValue()
40
+    {
41
+        return $this->_value;
42
+    }
43
+    public function setValue($value)
44
+    {
45
+        $this->_value = $value;
46
+    }
47
+}

+ 61
- 0
src/Auth/DBO/LuticatePermissionsGroupsDbo.php View File

@@ -0,0 +1,61 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ */
7
+
8
+namespace Luticate\Auth\DBO;
9
+
10
+use Luticate\Utils\LuDbo;
11
+
12
+class LuticatePermissionsGroupsDbo extends LuDbo {
13
+
14
+    public function jsonSerialize()
15
+    {
16
+        return array(
17
+            "Name" => $this->_name,
18
+            "Value" => $this->_value,
19
+            "GroupId" => $this->_groupId
20
+        );
21
+    }
22
+
23
+    /**
24
+     * @var string
25
+     */
26
+    protected $_name;
27
+    public function getName()
28
+    {
29
+        return $this->_name;
30
+    }
31
+    public function setName($value)
32
+    {
33
+        $this->_name = $value;
34
+    }
35
+
36
+    /**
37
+     * @var boolean
38
+     */
39
+    protected $_value;
40
+    public function getValue()
41
+    {
42
+        return $this->_value;
43
+    }
44
+    public function setValue($value)
45
+    {
46
+        $this->_value = $value;
47
+    }
48
+
49
+    /**
50
+     * @var integer
51
+     */
52
+    protected $_groupId;
53
+    public function getGroupId()
54
+    {
55
+        return $this->_groupId;
56
+    }
57
+    public function setGroupId($value)
58
+    {
59
+        $this->_groupId = $value;
60
+    }
61
+}

+ 61
- 0
src/Auth/DBO/LuticatePermissionsUsersDbo.php View File

@@ -0,0 +1,61 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ */
7
+
8
+namespace Luticate\Auth\DBO;
9
+
10
+use Luticate\Utils\LuDbo;
11
+
12
+class LuticatePermissionsUsersDbo extends LuDbo {
13
+
14
+    public function jsonSerialize()
15
+    {
16
+        return array(
17
+            "Name" => $this->_name,
18
+            "Value" => $this->_value,
19
+            "UserId" => $this->_userId
20
+        );
21
+    }
22
+
23
+    /**
24
+     * @var string
25
+     */
26
+    protected $_name;
27
+    public function getName()
28
+    {
29
+        return $this->_name;
30
+    }
31
+    public function setName($value)
32
+    {
33
+        $this->_name = $value;
34
+    }
35
+
36
+    /**
37
+     * @var boolean
38
+     */
39
+    protected $_value;
40
+    public function getValue()
41
+    {
42
+        return $this->_value;
43
+    }
44
+    public function setValue($value)
45
+    {
46
+        $this->_value = $value;
47
+    }
48
+
49
+    /**
50
+     * @var integer
51
+     */
52
+    protected $_userId;
53
+    public function getUserId()
54
+    {
55
+        return $this->_userId;
56
+    }
57
+    public function setUserId($value)
58
+    {
59
+        $this->_userId = $value;
60
+    }
61
+}

+ 89
- 0
src/Auth/DBO/LuticateUsersDbo.php View File

@@ -0,0 +1,89 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ */
7
+
8
+namespace Luticate\Auth\DBO;
9
+
10
+use Luticate\Utils\LuDbo;
11
+
12
+class LuticateUsersDbo extends LuDbo {
13
+
14
+    public function jsonSerialize()
15
+    {
16
+        return array(
17
+            "Id" => $this->_id,
18
+            "Username" => $this->_username,
19
+            "Email" => $this->_email,
20
+            "Password" => $this->_password,
21
+            "Salt" => $this->_salt
22
+        );
23
+    }
24
+
25
+    /**
26
+     * @var integer
27
+     */
28
+    protected $_id;
29
+    public function getId()
30
+    {
31
+        return $this->_id;
32
+    }
33
+    public function setId($value)
34
+    {
35
+        $this->_id = $value;
36
+    }
37
+
38
+    /**
39
+     * @var string
40
+     */
41
+    protected $_username;
42
+    public function getUsername()
43
+    {
44
+        return $this->_username;
45
+    }
46
+    public function setUsername($value)
47
+    {
48
+        $this->_username = $value;
49
+    }
50
+
51
+    /**
52
+     * @var string
53
+     */
54
+    protected $_email;
55
+    public function getEmail()
56
+    {
57
+        return $this->_email;
58
+    }
59
+    public function setEmail($value)
60
+    {
61
+        $this->_email = $value;
62
+    }
63
+
64
+    /**
65
+     * @var string
66
+     */
67
+    protected $_password;
68
+    public function getPassword()
69
+    {
70
+        return $this->_password;
71
+    }
72
+    public function setPassword($value)
73
+    {
74
+        $this->_password = $value;
75
+    }
76
+
77
+    /**
78
+     * @var string
79
+     */
80
+    protected $_salt;
81
+    public function getSalt()
82
+    {
83
+        return $this->_salt;
84
+    }
85
+    public function setSalt($value)
86
+    {
87
+        $this->_salt = $value;
88
+    }
89
+}

+ 15
- 0
src/Auth/DataAccess/LuticateGroupsDataAccess.php View File

@@ -0,0 +1,15 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess;
4
+
5
+use Luticate\Utils\LuDataAccess;
6
+use Luticate\Auth\DataAccess\Models\LuticateGroups;
7
+use Luticate\Auth\DBO\LuticateGroupsDbo;
8
+
9
+class LuticateGroupsDataAccess extends LuDataAccess {
10
+    public function __construct()
11
+    {
12
+        parent::__construct();
13
+        $this->model = new LuticateGroups();
14
+    }
15
+}

+ 15
- 0
src/Auth/DataAccess/LuticatePermissionsDataAccess.php View File

@@ -0,0 +1,15 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess;
4
+
5
+use Luticate\Utils\LuDataAccess;
6
+use Luticate\Auth\DataAccess\Models\LuticatePermissions;
7
+use Luticate\Auth\DBO\LuticatePermissionsDbo;
8
+
9
+class LuticatePermissionsDataAccess extends LuDataAccess {
10
+    public function __construct()
11
+    {
12
+        parent::__construct();
13
+        $this->model = new LuticatePermissions();
14
+    }
15
+}

+ 15
- 0
src/Auth/DataAccess/LuticatePermissionsGroupsDataAccess.php View File

@@ -0,0 +1,15 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess;
4
+
5
+use Luticate\Utils\LuDataAccess;
6
+use Luticate\Auth\DataAccess\Models\LuticatePermissionsGroups;
7
+use Luticate\Auth\DBO\LuticatePermissionsGroupsDbo;
8
+
9
+class LuticatePermissionsGroupsDataAccess extends LuDataAccess {
10
+    public function __construct()
11
+    {
12
+        parent::__construct();
13
+        $this->model = new LuticatePermissionsGroups();
14
+    }
15
+}

+ 15
- 0
src/Auth/DataAccess/LuticatePermissionsUsersDataAccess.php View File

@@ -0,0 +1,15 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess;
4
+
5
+use Luticate\Utils\LuDataAccess;
6
+use Luticate\Auth\DataAccess\Models\LuticatePermissionsUsers;
7
+use Luticate\Auth\DBO\LuticatePermissionsUsersDbo;
8
+
9
+class LuticatePermissionsUsersDataAccess extends LuDataAccess {
10
+    public function __construct()
11
+    {
12
+        parent::__construct();
13
+        $this->model = new LuticatePermissionsUsers();
14
+    }
15
+}

+ 15
- 0
src/Auth/DataAccess/LuticateUsersDataAccess.php View File

@@ -0,0 +1,15 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess;
4
+
5
+use Luticate\Utils\LuDataAccess;
6
+use Luticate\Auth\DataAccess\Models\LuticateUsers;
7
+use Luticate\Auth\DBO\LuticateUsersDbo;
8
+
9
+class LuticateUsersDataAccess extends LuDataAccess {
10
+    public function __construct()
11
+    {
12
+        parent::__construct();
13
+        $this->model = new LuticateUsers();
14
+    }
15
+}

+ 9
- 0
src/Auth/DataAccess/Models/LuticateGroups.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess\Models;
4
+
5
+use Luticate\Auth\DBO\LuticateGroupsDbo;
6
+
7
+class LuticateGroups extends LuticateGroupsModel
8
+{
9
+}

+ 49
- 0
src/Auth/DataAccess/Models/LuticateGroupsModel.php View File

@@ -0,0 +1,49 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ * DO NOT DIRECTLY USE THIS FILE
7
+ * USE LuticateGroups.php
8
+ * TO MAKE YOUR CHANGES AND DATABASE ACCESS
9
+*/
10
+
11
+namespace Luticate\Auth\DataAccess\Models;
12
+
13
+use Luticate\Utils\LuModel;
14
+use Luticate\Auth\DBO\LuticateGroupsDbo;
15
+
16
+class LuticateGroupsModel extends LuModel
17
+{
18
+    function __construct()
19
+    {
20
+        parent::__construct();
21
+        $this->timestamps = false;
22
+    }
23
+
24
+    public function toDbo()
25
+    {
26
+        $dbo = new LuticateGroupsDbo();
27
+
28
+        $dbo->setId($this->id);
29
+        $dbo->setName($this->name);
30
+
31
+        return $dbo;
32
+    }
33
+
34
+    /**
35
+     * @param $dbo LuticateGroupsDbo
36
+     * @param $model LuModel|null
37
+     * @return LuticateGroups
38
+     */
39
+    public function fromDbo($dbo, $model = null)
40
+    {
41
+        if (is_null($model))
42
+            $model = new LuticateGroups();
43
+
44
+        $model->id = $dbo->getId();
45
+        $model->name = $dbo->getName();
46
+
47
+        return $model;
48
+    }
49
+}

+ 9
- 0
src/Auth/DataAccess/Models/LuticatePermissions.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess\Models;
4
+
5
+use Luticate\Auth\DBO\LuticatePermissionsDbo;
6
+
7
+class LuticatePermissions extends LuticatePermissionsModel
8
+{
9
+}

+ 9
- 0
src/Auth/DataAccess/Models/LuticatePermissionsGroups.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess\Models;
4
+
5
+use Luticate\Auth\DBO\LuticatePermissionsGroupsDbo;
6
+
7
+class LuticatePermissionsGroups extends LuticatePermissionsGroupsModel
8
+{
9
+}

+ 51
- 0
src/Auth/DataAccess/Models/LuticatePermissionsGroupsModel.php View File

@@ -0,0 +1,51 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ * DO NOT DIRECTLY USE THIS FILE
7
+ * USE LuticatePermissionsGroups.php
8
+ * TO MAKE YOUR CHANGES AND DATABASE ACCESS
9
+*/
10
+
11
+namespace Luticate\Auth\DataAccess\Models;
12
+
13
+use Luticate\Utils\LuModel;
14
+use Luticate\Auth\DBO\LuticatePermissionsGroupsDbo;
15
+
16
+class LuticatePermissionsGroupsModel extends LuModel
17
+{
18
+    function __construct()
19
+    {
20
+        parent::__construct();
21
+        $this->timestamps = false;
22
+    }
23
+
24
+    public function toDbo()
25
+    {
26
+        $dbo = new LuticatePermissionsGroupsDbo();
27
+
28
+        $dbo->setName($this->name);
29
+        $dbo->setValue($this->value);
30
+        $dbo->setGroupId($this->group_id);
31
+
32
+        return $dbo;
33
+    }
34
+
35
+    /**
36
+     * @param $dbo LuticatePermissionsGroupsDbo
37
+     * @param $model LuModel|null
38
+     * @return LuticatePermissionsGroups
39
+     */
40
+    public function fromDbo($dbo, $model = null)
41
+    {
42
+        if (is_null($model))
43
+            $model = new LuticatePermissionsGroups();
44
+
45
+        $model->name = $dbo->getName();
46
+        $model->value = $dbo->getValue();
47
+        $model->group_id = $dbo->getGroupId();
48
+
49
+        return $model;
50
+    }
51
+}

+ 49
- 0
src/Auth/DataAccess/Models/LuticatePermissionsModel.php View File

@@ -0,0 +1,49 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ * DO NOT DIRECTLY USE THIS FILE
7
+ * USE LuticatePermissions.php
8
+ * TO MAKE YOUR CHANGES AND DATABASE ACCESS
9
+*/
10
+
11
+namespace Luticate\Auth\DataAccess\Models;
12
+
13
+use Luticate\Utils\LuModel;
14
+use Luticate\Auth\DBO\LuticatePermissionsDbo;
15
+
16
+class LuticatePermissionsModel extends LuModel
17
+{
18
+    function __construct()
19
+    {
20
+        parent::__construct();
21
+        $this->timestamps = false;
22
+    }
23
+
24
+    public function toDbo()
25
+    {
26
+        $dbo = new LuticatePermissionsDbo();
27
+
28
+        $dbo->setName($this->name);
29
+        $dbo->setValue($this->value);
30
+
31
+        return $dbo;
32
+    }
33
+
34
+    /**
35
+     * @param $dbo LuticatePermissionsDbo
36
+     * @param $model LuModel|null
37
+     * @return LuticatePermissions
38
+     */
39
+    public function fromDbo($dbo, $model = null)
40
+    {
41
+        if (is_null($model))
42
+            $model = new LuticatePermissions();
43
+
44
+        $model->name = $dbo->getName();
45
+        $model->value = $dbo->getValue();
46
+
47
+        return $model;
48
+    }
49
+}

+ 9
- 0
src/Auth/DataAccess/Models/LuticatePermissionsUsers.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess\Models;
4
+
5
+use Luticate\Auth\DBO\LuticatePermissionsUsersDbo;
6
+
7
+class LuticatePermissionsUsers extends LuticatePermissionsUsersModel
8
+{
9
+}

+ 51
- 0
src/Auth/DataAccess/Models/LuticatePermissionsUsersModel.php View File

@@ -0,0 +1,51 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ * DO NOT DIRECTLY USE THIS FILE
7
+ * USE LuticatePermissionsUsers.php
8
+ * TO MAKE YOUR CHANGES AND DATABASE ACCESS
9
+*/
10
+
11
+namespace Luticate\Auth\DataAccess\Models;
12
+
13
+use Luticate\Utils\LuModel;
14
+use Luticate\Auth\DBO\LuticatePermissionsUsersDbo;
15
+
16
+class LuticatePermissionsUsersModel extends LuModel
17
+{
18
+    function __construct()
19
+    {
20
+        parent::__construct();
21
+        $this->timestamps = false;
22
+    }
23
+
24
+    public function toDbo()
25
+    {
26
+        $dbo = new LuticatePermissionsUsersDbo();
27
+
28
+        $dbo->setName($this->name);
29
+        $dbo->setValue($this->value);
30
+        $dbo->setUserId($this->user_id);
31
+
32
+        return $dbo;
33
+    }
34
+
35
+    /**
36
+     * @param $dbo LuticatePermissionsUsersDbo
37
+     * @param $model LuModel|null
38
+     * @return LuticatePermissionsUsers
39
+     */
40
+    public function fromDbo($dbo, $model = null)
41
+    {
42
+        if (is_null($model))
43
+            $model = new LuticatePermissionsUsers();
44
+
45
+        $model->name = $dbo->getName();
46
+        $model->value = $dbo->getValue();
47
+        $model->user_id = $dbo->getUserId();
48
+
49
+        return $model;
50
+    }
51
+}

+ 9
- 0
src/Auth/DataAccess/Models/LuticateUsers.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+namespace Luticate\Auth\DataAccess\Models;
4
+
5
+use Luticate\Auth\DBO\LuticateUsersDbo;
6
+
7
+class LuticateUsers extends LuticateUsersModel
8
+{
9
+}

+ 55
- 0
src/Auth/DataAccess/Models/LuticateUsersModel.php View File

@@ -0,0 +1,55 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ * DO NOT DIRECTLY USE THIS FILE
7
+ * USE LuticateUsers.php
8
+ * TO MAKE YOUR CHANGES AND DATABASE ACCESS
9
+*/
10
+
11
+namespace Luticate\Auth\DataAccess\Models;
12
+
13
+use Luticate\Utils\LuModel;
14
+use Luticate\Auth\DBO\LuticateUsersDbo;
15
+
16
+class LuticateUsersModel extends LuModel
17
+{
18
+    function __construct()
19
+    {
20
+        parent::__construct();
21
+        $this->timestamps = false;
22
+    }
23
+
24
+    public function toDbo()
25
+    {
26
+        $dbo = new LuticateUsersDbo();
27
+
28
+        $dbo->setId($this->id);
29
+        $dbo->setUsername($this->username);
30
+        $dbo->setEmail($this->email);
31
+        $dbo->setPassword($this->password);
32
+        $dbo->setSalt($this->salt);
33
+
34
+        return $dbo;
35
+    }
36
+
37
+    /**
38
+     * @param $dbo LuticateUsersDbo
39
+     * @param $model LuModel|null
40
+     * @return LuticateUsers
41
+     */
42
+    public function fromDbo($dbo, $model = null)
43
+    {
44
+        if (is_null($model))
45
+            $model = new LuticateUsers();
46
+
47
+        $model->id = $dbo->getId();
48
+        $model->username = $dbo->getUsername();
49
+        $model->email = $dbo->getEmail();
50
+        $model->password = $dbo->getPassword();
51
+        $model->salt = $dbo->getSalt();
52
+
53
+        return $model;
54
+    }
55
+}

+ 44
- 0
src/Auth/DataAccess/SP/SpLuGetUserPermission.php View File

@@ -0,0 +1,44 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ */
7
+
8
+namespace Luticate\Auth\DataAccess\SP;
9
+
10
+use Luticate\Utils\LuSpModel;
11
+use Illuminate\Support\Facades\DB;
12
+
13
+class SpLuGetUserPermission extends LuSpModel {
14
+
15
+    protected static function damToDbo($dam)
16
+    {
17
+        if (is_null($dam))
18
+            return null;
19
+        $dbo = new SpLuGetUserPermission();
20
+
21
+        $dbo->setVal($dam->val);
22
+
23
+        return $dbo;
24
+    }
25
+
26
+    public static function execute($_user_id, $_permisson_name)
27
+    {
28
+        $values = DB::select('SELECT * FROM sp_lu_get_user_permission(?, ?)', array($_user_id, $_permisson_name));
29
+        return self::damToDbo($values[0]);
30
+    }
31
+
32
+    /**
33
+    * @var boolean
34
+    */
35
+    protected $_val;
36
+    public function getVal()
37
+    {
38
+        return $this->_val;
39
+    }
40
+    public function setVal($value)
41
+    {
42
+        $this->_val = $value;
43
+    }
44
+}

+ 44
- 0
src/Auth/DataAccess/SP/SpLuRemovePermission.php View File

@@ -0,0 +1,44 @@
1
+<?php
2
+
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ */
7
+
8
+namespace Luticate\Auth\DataAccess\SP;
9
+
10
+use Luticate\Utils\LuSpModel;
11
+use Illuminate\Support\Facades\DB;
12
+
13
+class SpLuRemovePermission extends LuSpModel {
14
+
15
+    protected static function damToDbo($dam)
16
+    {
17
+        if (is_null($dam))
18
+            return null;
19
+        $dbo = new SpLuRemovePermission();
20
+
21
+        $dbo->setSpLuRemovePermission($dam->sp_lu_remove_permission);
22
+
23
+        return $dbo;
24
+    }
25
+
26
+    public static function execute($_permisson_name)
27
+    {
28
+        $values = DB::select('SELECT * FROM sp_lu_remove_permission(?)', array($_permisson_name));
29
+        return self::damToDbo($values[0]);
30
+    }
31
+
32
+    /**
33
+    * @var boolean
34
+    */
35
+    protected $_spLuRemovePermission;
36
+    public function getSpLuRemovePermission()
37
+    {
38
+        return $this->_spLuRemovePermission;
39
+    }
40
+    public function setSpLuRemovePermission($value)
41
+    {
42
+        $this->_spLuRemovePermission = $value;
43
+    }
44
+}

Loading…
Cancel
Save