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. 10
      app/Models/Aauth/LoginAttemptModel.php
  6. 9
      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..
*
* @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay
* @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/
namespace App\Models\Aauth;
use CodeIgniter\Model;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Validation\ValidationInterface;
use Config\Aauth as AauthConfig;
/**
@ -51,8 +53,12 @@ class GroupModel extends Model
/**
* 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))
{

2
app/Models/Aauth/GroupToGroupModel.php

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

2
app/Models/Aauth/GroupToUserModel.php

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

2
app/Models/Aauth/GroupVariableModel.php

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

10
app/Models/Aauth/LoginAttemptModel.php

@ -8,12 +8,12 @@
* access management, public access etc..
*
* @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay
* @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/
namespace App\Models\Aauth;
@ -74,11 +74,11 @@ class LoginAttemptModel
/**
* Constructor
*
* @param ConnectionInterface $db Database connection
*
* @return void
* @param ConnectionInterface $db Database connection
* @param \Config\Aauth $config Config Object
* @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))
{

9
app/Models/Aauth/LoginTokenModel.php

@ -8,12 +8,12 @@
* access management, public access etc..
*
* @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay
* @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/
namespace App\Models\Aauth;
@ -128,16 +128,17 @@ class LoginTokenModel
/**
* 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
*/
public function update(int $tokenId)
public function update(int $tokenId, string $expiresAt = null)
{
$builder = $this->builder();
$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');
return $builder->set($data)->update();

10
app/Models/Aauth/PermModel.php

@ -8,17 +8,19 @@
* access management, public access etc..
*
* @package CodeIgniter-Aauth
* @since 3.0.0
* @author Emre Akay
* @author Raphael "REJack" Jackstadt
* @copyright 2014-2019 Emre Akay
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/emreakay/CodeIgniter-Aauth
* @since 3.0.0
*/
namespace App\Models\Aauth;
use CodeIgniter\Model;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Validation\ValidationInterface;
use Config\Aauth as AauthConfig;
/**
@ -51,8 +53,12 @@ class PermModel extends Model
/**
* 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))
{

2
app/Models/Aauth/PermToGroupModel.php

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

2
app/Models/Aauth/PermToUserModel.php

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

15
app/Models/Aauth/UserModel.php

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

2
app/Models/Aauth/UserSessionModel.php

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

2
app/Models/Aauth/UserVariableModel.php

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

Loading…
Cancel
Save