easyappointments/doc/code/php/class-Google.html

295 lines
6.5 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="ApiGen 2.8.0" />
<title>Class Google</title>
<script type="text/javascript" src="resources/combined.js?955602237"></script>
<script type="text/javascript" src="elementlist.js?3375239373"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" />
</head>
<body>
<div id="left">
<div id="menu">
<a href="index.html" title="Overview"><span>Overview</span></a>
<div id="groups">
<h3>Namespaces</h3>
<ul>
<li class="active"><a href="namespace-None.html">None</a>
</li>
<li><a href="namespace-PHP.html">PHP</a>
</li>
</ul>
</div>
<hr />
<div id="elements">
<h3>Classes</h3>
<ul>
<li><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 class="active"><a href="class-Google.html">Google</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>
</ul>
</div>
</div>
</div>
<div id="splitter"></div>
<div id="right">
<div id="rightInner">
<form id="search">
<input type="hidden" name="cx" value="" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" class="text" />
<input type="submit" value="Search" />
</form>
<div id="navigation">
<ul>
<li>
<a href="index.html" title="Overview"><span>Overview</span></a>
</li>
<li>
<a href="namespace-None.html" title="Summary of None"><span>Namespace</span></a>
</li>
<li class="active">
<span>Class</span> </li>
</ul>
<ul>
<li>
<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
</li>
</ul>
<ul>
</ul>
</div>
<div id="content" class="class">
<h1>Class Google</h1>
<dl class="tree">
<dd style="padding-left:0px">
CI_Controller
</dd>
<dd style="padding-left:30px">
<img src="resources/inherit.png" alt="Extended by" />
<b><span>Google</span></b>
</dd>
</dl>
<div class="info">
<b>Located at</b> <a href="source-class-Google.html#3-196" title="Go to source code">google.php</a><br />
</div>
<table class="summary" id="methods">
<caption>Methods summary</caption>
<tr data-order="oauth" id="_oauth">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_oauth">#</a>
<code><a href="source-class-Google.html#4-24" title="Go to source code">oauth</a>( <span>integer <var>$provider_id</var></span> )</code>
<div class="description short">
<p>Authorize Google Calendar API usage for a specific provider.</p>
</div>
<div class="description detailed hidden">
<p>Authorize Google Calendar API usage for a specific provider.</p>
<p>Since it is required to follow the web application flow, in order to retrieve
a refresh token from the Google API service, this method is going to authorize
the given provider.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$provider_id</var></dt>
<dd><code>integer</code><br>$provider_id The provider id, for whom the sync authorization is made.</dd>
</dl></div>
</div>
</div></td>
</tr>
<tr data-order="oauth_callback" id="_oauth_callback">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_oauth_callback">#</a>
<code><a href="source-class-Google.html#26-65" title="Go to source code">oauth_callback</a>( )</code>
<div class="description short">
<p>Callback method for the Google Calendar API authorization process.</p>
</div>
<div class="description detailed hidden">
<p>Callback method for the Google Calendar API authorization process.</p>
<p>Once the user grants consent with his Google Calendar data usage, the Google
OAuth service will redirect him back in this page. Here we are going to store
the refresh token, because this is what will be used to generate access tokens
in the future.</p>
<p>&lt;strong&gt;IMPORTANT!&lt;/strong&gt; Because it is necessary to authorize
the application using the web server flow (see official documentation of OAuth),
every Easy!Appointments installation should use its own calendar api key. So in
every api console account, the "http://path-to-e!a/google/oauth_callback" should
be included in an allowed redirect url.</p>
</div>
</div></td>
</tr>
<tr data-order="sync" id="_sync">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_sync">#</a>
<code><a href="source-class-Google.html#67-195" title="Go to source code">sync</a>( <span>numeric <var>$provider_id</var> = <span class="php-keyword1">NULL</span></span> )</code>
<div class="description short">
<p>Complete synchronization of appointments between Google Calendar and
Easy!Appointments.</p>
</div>
<div class="description detailed hidden">
<p>Complete synchronization of appointments between Google Calendar and
Easy!Appointments.</p>
<p>This method will completely sync the appointments of a provider with his
Google Calendar account. The sync period needs to be relatively small, because a
lot of API calls might be necessary and this will lead to consuming the Google
limit for the Calendar API usage.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$provider_id</var></dt>
<dd><code>numeric</code><br>$provider_id Provider record to be synced.</dd>
</dl></div>
<h4>Task</h4>
<div class="list">
This method must be executed only by the system and noone else outside. It is a
big security issue.<br />
</div>
</div>
</div></td>
</tr>
</table>
</div>
<div id="footer">
API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
</div>
</div>
</div>
</body>
</html>