This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/oauth/classes/Model/Oauth.php

33 lines
651 B
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB OAuth Model
*
* @package OAuth
* @category Models
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Oauth extends ORM {
// Relationships
protected $_has_many = array(
'account_oauth' => array('far_key'=>'id'),
);
/**
* Return the object of the OAuth plugin
*/
public function plugin($type='') {
$c = 'OAuth_Plugin_'.ucfirst($this->name);
if (! $this->name OR ! class_exists($c))
return NULL;
$o = new $c($this);
return $type ? $o->$type : $o;
}
}
?>