Browse Source

updated Models

- updated __construct in GroupModel, PermModel & UserModel
- updated PHPdocs overall files
v3-dev
REJack 6 years ago
parent
commit
cfa13703fd
  1. 10
      app/Models/Aauth/GroupModel.php
  2. 2
      app/Models/Aauth/GroupToGroupModel.php
  3. 2
      app/Models/Aauth/GroupToUserModel.php
  4. 2
      app/Models/Aauth/GroupVariableModel.php
  5. 8
      app/Models/Aauth/LoginAttemptModel.php
  6. 7
      app/Models/Aauth/LoginTokenModel.php
  7. 10
      app/Models/Aauth/PermModel.php
  8. 2
      app/Models/Aauth/PermToGroupModel.php
  9. 2
      app/Models/Aauth/PermToUserModel.php
  10. 15
      app/Models/Aauth/UserModel.php
  11. 2
      app/Models/Aauth/UserSessionModel.php
  12. 2
      app/Models/Aauth/UserVariableModel.php

10
app/Models/Aauth/GroupModel.php

@ -8,17 +8,19 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;
use CodeIgniter\Model; use CodeIgniter\Model;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Validation\ValidationInterface;
use Config\Aauth as AauthConfig; use Config\Aauth as AauthConfig;
/** /**
@ -51,8 +53,12 @@ class GroupModel extends Model
/** /**
* Constructor * Constructor
*
* @param ConnectionInterface $db Connection Interface
* @param ValidationInterface $validation Validation Interface
* @param \Config\Aauth $config Config Object
*/ */
public function __construct($db = null, $validation = null, $config = null) public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null, \Config\Aauth $config = null)
{ {
if (is_null($config)) if (is_null($config))
{ {

2
app/Models/Aauth/GroupToGroupModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;

2
app/Models/Aauth/GroupToUserModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;

2
app/Models/Aauth/GroupVariableModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;

8
app/Models/Aauth/LoginAttemptModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;
@ -75,10 +75,10 @@ class LoginAttemptModel
* Constructor * Constructor
* *
* @param ConnectionInterface $db Database connection * @param ConnectionInterface $db Database connection
* * @param \Config\Aauth $config Config Object
* @return void * @param \CodeIgniter\HTTP\Response $response Response Class
*/ */
public function __construct(ConnectionInterface &$db = null, $config = null, $response = null) public function __construct(ConnectionInterface &$db = null, \Config\Aauth $config = null, \CodeIgniter\HTTP\Response $response = null)
{ {
if (is_null($config)) if (is_null($config))
{ {

7
app/Models/Aauth/LoginTokenModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;
@ -129,15 +129,16 @@ class LoginTokenModel
* Update Login Token by tokenId * Update Login Token by tokenId
* *
* @param integer $tokenId Login Token id * @param integer $tokenId Login Token id
* @param string $expiresAt Custom expires at date
* *
* @return boolean * @return boolean
*/ */
public function update(int $tokenId) public function update(int $tokenId, string $expiresAt = null)
{ {
$builder = $this->builder(); $builder = $this->builder();
$builder->where('id', $tokenId); $builder->where('id', $tokenId);
$data['expires_at'] = date('Y-m-d H:i:s', strtotime($this->config->loginRemember)); $data['expires_at'] = date('Y-m-d H:i:s', strtotime($expiresAt ?: $this->config->loginRemember));
$data['updated_at'] = date('Y-m-d H:i:s'); $data['updated_at'] = date('Y-m-d H:i:s');
return $builder->set($data)->update(); return $builder->set($data)->update();

10
app/Models/Aauth/PermModel.php

@ -8,17 +8,19 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;
use CodeIgniter\Model; use CodeIgniter\Model;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Validation\ValidationInterface;
use Config\Aauth as AauthConfig; use Config\Aauth as AauthConfig;
/** /**
@ -51,8 +53,12 @@ class PermModel extends Model
/** /**
* Constructor * Constructor
*
* @param ConnectionInterface $db Connection Interface
* @param ValidationInterface $validation Validation Interface
* @param \Config\Aauth $config Config Object
*/ */
public function __construct($db = null, $validation = null, $config = null) public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null, \Config\Aauth $config = null)
{ {
if (is_null($config)) if (is_null($config))
{ {

2
app/Models/Aauth/PermToGroupModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;

2
app/Models/Aauth/PermToUserModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;

15
app/Models/Aauth/UserModel.php

@ -8,17 +8,19 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;
use CodeIgniter\Model; use CodeIgniter\Model;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Validation\ValidationInterface;
use Config\Aauth as AauthConfig; use Config\Aauth as AauthConfig;
/** /**
@ -76,8 +78,12 @@ class UserModel extends Model
/** /**
* Constructor * Constructor
*
* @param ConnectionInterface $db Connection Interface
* @param ValidationInterface $validation Validation Interface
* @param \Config\Aauth $config Config Object
*/ */
public function __construct($db = null, $validation = null, $config = null) public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null, \Config\Aauth $config = null)
{ {
if (is_null($config)) if (is_null($config))
{ {
@ -125,6 +131,11 @@ class UserModel extends Model
/** /**
* Update * Update
*
* @param integer|array|string $id User Id
* @param array|object $data Data Array
*
* @return boolean
*/ */
public function update($id = null, $data = null) public function update($id = null, $data = null)
{ {

2
app/Models/Aauth/UserSessionModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;

2
app/Models/Aauth/UserVariableModel.php

@ -8,12 +8,12 @@
* access management, public access etc.. * access management, public access etc..
* *
* @package CodeIgniter-Aauth * @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay * @author Emre Akay
* @author Raphael "REJack" Jackstadt * @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay * @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth * @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/ */
namespace App\Models\Aauth; namespace App\Models\Aauth;

Loading…
Cancel
Save