mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-30 03:42:44 +03:00
722 lines
18 KiB
HTML
722 lines
18 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
<title>Class Admins_Model</title>
|
|
|
|
<link rel="stylesheet" href="resources/bootstrap.min.css?08b23951ef4599ca9cbf1f902d0e8290c9653ddd">
|
|
<link rel="stylesheet" href="resources/style.css?062e9e59e0b8c44fbaaded5b7ffc21f907b78669">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<div id="navigation" class="navbar navbar-fixed-top">
|
|
<div class="navbar-inner">
|
|
<div class="container">
|
|
<a href="index.html" class="brand">Overview</a>
|
|
<div class="nav-collapse">
|
|
<ul class="nav">
|
|
<li class="active">
|
|
<span>Class</span> </li>
|
|
|
|
<li class="divider-vertical"></li>
|
|
|
|
<li>
|
|
<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
|
|
</li>
|
|
<li>
|
|
<a href="todo.html" title="Todo list"><span>Todo</span></a>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="left">
|
|
<div id="menu">
|
|
<form id="search" class="form-search">
|
|
<input type="hidden" name="cx" value="">
|
|
<input type="hidden" name="ie" value="UTF-8">
|
|
<input type="text" name="q" class="search-query" placeholder="Search">
|
|
</form>
|
|
|
|
|
|
<div id="groups">
|
|
</div>
|
|
|
|
|
|
<div id="elements">
|
|
<h3>Classes</h3>
|
|
<ul>
|
|
<li class="active"><a href="class-Admins_Model.html">Admins_Model</a></li>
|
|
<li><a href="class-Appointments.html">Appointments</a></li>
|
|
<li><a href="class-Appointments_Model.html">Appointments_Model</a></li>
|
|
<li><a href="class-Backend.html">Backend</a></li>
|
|
<li><a href="class-Backend_api.html">Backend_api</a></li>
|
|
<li><a href="class-Customers_Model.html">Customers_Model</a></li>
|
|
<li><a href="class-Errors.html">Errors</a></li>
|
|
<li><a href="class-Google.html">Google</a></li>
|
|
<li><a href="class-Google_Sync.html">Google_Sync</a></li>
|
|
<li><a href="class-Notifications.html">Notifications</a></li>
|
|
<li><a href="class-Providers_Model.html">Providers_Model</a></li>
|
|
<li><a href="class-Roles_Model.html">Roles_Model</a></li>
|
|
<li><a href="class-Secretaries_Model.html">Secretaries_Model</a></li>
|
|
<li><a href="class-Services_Model.html">Services_Model</a></li>
|
|
<li><a href="class-Settings_Model.html">Settings_Model</a></li>
|
|
<li><a href="class-Test.html">Test</a></li>
|
|
<li><a href="class-Unit_tests.html">Unit_tests</a></li>
|
|
<li><a href="class-Unit_tests_admins_model.html">Unit_tests_admins_model</a></li>
|
|
<li><a href="class-Unit_tests_appointments_model.html">Unit_tests_appointments_model</a></li>
|
|
<li><a href="class-Unit_tests_customers_model.html">Unit_tests_customers_model</a></li>
|
|
<li><a href="class-Unit_tests_providers_model.html">Unit_tests_providers_model</a></li>
|
|
<li><a href="class-Unit_tests_secretaries_model.html">Unit_tests_secretaries_model</a></li>
|
|
<li><a href="class-Unit_tests_services_model.html">Unit_tests_services_model</a></li>
|
|
<li><a href="class-Unit_tests_settings_model.html">Unit_tests_settings_model</a></li>
|
|
<li><a href="class-User.html">User</a></li>
|
|
<li><a href="class-User_Model.html">User_Model</a></li>
|
|
</ul>
|
|
|
|
<h3>Interfaces</h3>
|
|
<ul>
|
|
<li class="active"><a href="class-Admins_Model.html">Admins_Model</a></li>
|
|
<li><a href="class-Appointments.html">Appointments</a></li>
|
|
<li><a href="class-Appointments_Model.html">Appointments_Model</a></li>
|
|
<li><a href="class-Backend.html">Backend</a></li>
|
|
<li><a href="class-Backend_api.html">Backend_api</a></li>
|
|
<li><a href="class-Customers_Model.html">Customers_Model</a></li>
|
|
<li><a href="class-Errors.html">Errors</a></li>
|
|
<li><a href="class-Google.html">Google</a></li>
|
|
<li><a href="class-Google_Sync.html">Google_Sync</a></li>
|
|
<li><a href="class-Notifications.html">Notifications</a></li>
|
|
<li><a href="class-Providers_Model.html">Providers_Model</a></li>
|
|
<li><a href="class-Roles_Model.html">Roles_Model</a></li>
|
|
<li><a href="class-Secretaries_Model.html">Secretaries_Model</a></li>
|
|
<li><a href="class-Services_Model.html">Services_Model</a></li>
|
|
<li><a href="class-Settings_Model.html">Settings_Model</a></li>
|
|
<li><a href="class-Test.html">Test</a></li>
|
|
<li><a href="class-Unit_tests.html">Unit_tests</a></li>
|
|
<li><a href="class-Unit_tests_admins_model.html">Unit_tests_admins_model</a></li>
|
|
<li><a href="class-Unit_tests_appointments_model.html">Unit_tests_appointments_model</a></li>
|
|
<li><a href="class-Unit_tests_customers_model.html">Unit_tests_customers_model</a></li>
|
|
<li><a href="class-Unit_tests_providers_model.html">Unit_tests_providers_model</a></li>
|
|
<li><a href="class-Unit_tests_secretaries_model.html">Unit_tests_secretaries_model</a></li>
|
|
<li><a href="class-Unit_tests_services_model.html">Unit_tests_services_model</a></li>
|
|
<li><a href="class-Unit_tests_settings_model.html">Unit_tests_settings_model</a></li>
|
|
<li><a href="class-User.html">User</a></li>
|
|
<li><a href="class-User_Model.html">User_Model</a></li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="splitter"></div>
|
|
|
|
<div id="right">
|
|
<div id="rightInner">
|
|
<div id="content" class="class">
|
|
<h1>Class Admins_Model</h1>
|
|
|
|
|
|
<div class="description">
|
|
<p>Admins_Model Class</p>
|
|
|
|
<p>Handles the database actions for admin users management.</p>
|
|
|
|
<p>Data Structure: 'fist_name' 'last_name' (required) 'email' (required) 'mobile_number' 'phone_number' (required) 'address' 'city' 'state' 'zip_code' 'notes' 'id_roles' 'settings' >>> array that contains user settings (username, password etc)</p>
|
|
</div>
|
|
|
|
<dl class="tree well">
|
|
<dd style="padding-left:0px">
|
|
CI_Model
|
|
|
|
|
|
</dd>
|
|
<dd style="padding-left:30px">
|
|
<img src="resources/inherit.png" alt="Extended by">
|
|
<b><span>Admins_Model</span></b>
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="alert alert-info">
|
|
|
|
|
|
|
|
|
|
|
|
<b>Located at</b> <a href="source-class-Admins_Model.html#3-386" title="Go to source code">admins_model.php</a>
|
|
<br>
|
|
</div>
|
|
|
|
|
|
|
|
<h2>Methods summary</h2>
|
|
<table class="summary table table-bordered table-striped methods" id="methods">
|
|
<tr data-order="__construct" id="___construct">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#___construct">#</a>
|
|
<code><a href="source-class-Admins_Model.html#23-28" title="Go to source code">__construct</a>( )</code>
|
|
|
|
<div class="description short">
|
|
<p>Class Constructor</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Class Constructor</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="add" id="_add">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
integer
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_add">#</a>
|
|
<code><a href="source-class-Admins_Model.html#30-51" title="Go to source code">add</a>( <span>array <var>$admin</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Add (insert or update) an admin user record into database.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Add (insert or update) an admin user record into database.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$admin</var></dt>
|
|
<dd>Contains the admin user data.</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
integer<br>Returns the record id.
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When the admin data are invalid (see validate() method).
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="exists" id="_exists">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
boolean
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_exists">#</a>
|
|
<code><a href="source-class-Admins_Model.html#53-76" title="Go to source code">exists</a>( <span>array <var>$admin</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Check whether a particular admin record exists in the database.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Check whether a particular admin record exists in the database.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$admin</var></dt>
|
|
<dd><p>Contains the admin data. The 'email' value is required to be present
|
|
at the moment.</p></dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
boolean<br>Returns whether the record exists or not.
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When the 'email' value is not present on the $admin argument.
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="insert" id="_insert">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
integer
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_insert">#</a>
|
|
<code><a href="source-class-Admins_Model.html#78-112" title="Go to source code">insert</a>( <span>array <var>$admin</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Insert a new admin record into the database.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Insert a new admin record into the database.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$admin</var></dt>
|
|
<dd>Contains the admin data.</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
integer<br>Returns the new record id.
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When the insert operation fails.
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="update" id="_update">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
integer
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_update">#</a>
|
|
<code><a href="source-class-Admins_Model.html#114-144" title="Go to source code">update</a>( <span>array <var>$admin</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Update an existing admin record in the database.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Update an existing admin record in the database.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$admin</var></dt>
|
|
<dd>Contains the admin record data.</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
integer<br>Retuns the record id.
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When the update operation fails.
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="find_record_id" id="_find_record_id">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
integer
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_find_record_id">#</a>
|
|
<code><a href="source-class-Admins_Model.html#146-172" title="Go to source code">find_record_id</a>( <span>array <var>$admin</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Find the database record id of an admin user.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Find the database record id of an admin user.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$admin</var></dt>
|
|
<dd><p>Contains the admin data. The 'email' value is required in order to
|
|
find the record id.</p></dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
integer<br>Returns the record id
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When the 'email' value is not present on the $admin array.
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="validate" id="_validate">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
boolean
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_validate">#</a>
|
|
<code><a href="source-class-Admins_Model.html#174-242" title="Go to source code">validate</a>( <span>array <var>$admin</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Validate admin user data before add() operation is executed.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Validate admin user data before add() operation is executed.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$admin</var></dt>
|
|
<dd>Contains the admin user data.</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
boolean<br>Returns the validation result.
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When data are invalid.
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="delete" id="_delete">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
boolean
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_delete">#</a>
|
|
<code><a href="source-class-Admins_Model.html#244-273" title="Go to source code">delete</a>( <span>numeric <var>$admin_id</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Delete an existing admin record from the database.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Delete an existing admin record from the database.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$admin_id</var></dt>
|
|
<dd>The admin record id to be deleted.</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
boolean<br>Returns the delete operation result.
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When the $admin_id is not a valid numeric value.<br>
|
|
Exception<br><p>When the record to be deleted is the only one admin user left on
|
|
the system.</p>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="get_row" id="_get_row">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
array
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_get_row">#</a>
|
|
<code><a href="source-class-Admins_Model.html#275-300" title="Go to source code">get_row</a>( <span>numeric <var>$admin_id</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Get a specific admin record from the database.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Get a specific admin record from the database.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$admin_id</var></dt>
|
|
<dd>The id of the record to be returned.</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
array<br>Returns an array with the admin user data.
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When the $admin_id is not a valid numeric value.
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="get_value" id="_get_value">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
string
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_get_value">#</a>
|
|
<code><a href="source-class-Admins_Model.html#302-337" title="Go to source code">get_value</a>( <span>string <var>$field_name</var></span>, <span>numeric <var>$admin_id</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Get a specific field value from the database.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Get a specific field value from the database.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$field_name</var></dt>
|
|
<dd>The field name of the value to be returned.</dd>
|
|
<dt><var>$admin_id</var></dt>
|
|
<dd>Record id of the value to be returned.</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
string<br>Returns the selected record value from the database.
|
|
</div>
|
|
|
|
<h4>Throws</h4>
|
|
<div class="list">
|
|
Exception<br>When the $field_name argument is not a valid string.<br>
|
|
Exception<br>When the $admin_id is not a valid numeric.<br>
|
|
Exception<br>When the admin record does not exist in the database.<br>
|
|
Exception<br>When the selected field value is not present on database.
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="get_batch" id="_get_batch">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
array
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_get_batch">#</a>
|
|
<code><a href="source-class-Admins_Model.html#339-363" title="Go to source code">get_batch</a>( <span>string|array <var>$where_clause</var> = <span class="php-quote">''</span></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Get all, or specific admin records from database.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Get all, or specific admin records from database.</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$where_clause</var></dt>
|
|
<dd><p>(OPTIONAL) The WHERE clause of the query to be executed.
|
|
Use this to get specific admin records.</p></dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
array<br>Returns an array with admin records.
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="get_admin_role_id" id="_get_admin_role_id">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
integer
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_get_admin_role_id">#</a>
|
|
<code><a href="source-class-Admins_Model.html#365-372" title="Go to source code">get_admin_role_id</a>( )</code>
|
|
|
|
<div class="description short">
|
|
<p>Get the admin users role id.</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Get the admin users role id.</p>
|
|
|
|
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
integer<br>Returns the role record id.
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
<tr data-order="validate_username" id="_validate_username">
|
|
|
|
<td class="attributes"><code>
|
|
public
|
|
boolean
|
|
|
|
</code>
|
|
</td>
|
|
|
|
<td class="name"><div>
|
|
<a class="anchor" href="#_validate_username">#</a>
|
|
<code><a href="source-class-Admins_Model.html#374-385" title="Go to source code">validate_username</a>( <span>string <var>$username</var></span>, <span>numeric <var>$user_id</var></span> )</code>
|
|
|
|
<div class="description short">
|
|
<p>Validate Records Username</p>
|
|
</div>
|
|
|
|
<div class="description detailed hidden">
|
|
<p>Validate Records Username</p>
|
|
|
|
|
|
<h4>Parameters</h4>
|
|
<div class="list"><dl>
|
|
<dt><var>$username</var></dt>
|
|
<dd>The provider records username.</dd>
|
|
<dt><var>$user_id</var></dt>
|
|
<dd>The user record id.</dd>
|
|
</dl></div>
|
|
|
|
<h4>Returns</h4>
|
|
<div class="list">
|
|
boolean<br>Returns the validation result.
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div></td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
|
|
<h3>Magic methods summary</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div id="footer">
|
|
API documentation generated by <a href="http://apigen.org">ApiGen</a>
|
|
</div>
|
|
</div>
|
|
<script src="resources/combined.js"></script>
|
|
<script src="elementlist.js"></script>
|
|
</body>
|
|
</html>
|