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
655 B
PHP
Raw Normal View History

2013-05-23 07:00:14 +00:00
<?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_OSB {
// Relationships
protected $_has_many = array(
'account_oauth' => array('far_key'=>'id'),
);
/**
* Return the object of the OAuth plugin
*/
public function plugin($type='') {
2013-05-27 12:10:41 +00:00
$c = 'OAuth_Plugin_'.ucfirst($this->name);
2013-05-23 07:00:14 +00:00
if (! $this->name OR ! class_exists($c))
return NULL;
$o = new $c($this);
return $type ? $o->$type : $o;
}
}
?>