Skip to content

Instantly share code, notes, and snippets.

@macnibblet
Created January 5, 2012 17:55
Show Gist options
  • Save macnibblet/1566367 to your computer and use it in GitHub Desktop.
Save macnibblet/1566367 to your computer and use it in GitHub Desktop.
<?php
/**
* @author Antoine Hedgecock <antoine@pmg.se>
*/
/**
* @namespace
*/
namespace App\Auth;
/**
* @category App
* @package Auth
*/
class Result extends \Zend_Auth_Result
{
const FAILURE_DELETED = -4;
const FAILURE_FACEBOOK_ACCOUNT = -5;
const FAILURE_NOT_APPROVED = -6;
const FAILURE_UNCATEGORIZED = -7;
/**
* Sets the result code, identity, and failure messages
*
* who ever wrote this didn't expect for people to extend it...
*
* @param int $code
* @param mixed $identity
* @param array $messages
* @return void
*/
public function __construct($code, $identity, array $messages = array())
{
$code = (int) $code;
if ($code < self::FAILURE_UNCATEGORIZED) {
$code = self::FAILURE;
} elseif ($code > self::SUCCESS ) {
$code = 1;
}
$this->_code = $code;
$this->_identity = $identity;
$this->_messages = $messages;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment