/** * Create an exception, using a static code value found in the Rframe * class. * * @param int $code * @param string $message (optional) */ public function __construct($code, $message = null) { if (!$message) { $message = Rframe::get_message($code); } parent::__construct($message, $code); }
/** * Create a new API framework for a given User * * @param User $u */ public function __construct(User $u) { if (!$u || !$u->exists() || !$u->user_id) { throw new Exception("Invalid user specified!"); } // send User to parent ini $ini = array('user' => $u); parent::__construct(APPPATH . $this->api_path, $this->namespace, $ini); }