Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created July 17, 2012 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakura10/3131450 to your computer and use it in GitHub Desktop.
Save bakura10/3131450 to your computer and use it in GitHub Desktop.
Common\Authentication\Options\Configuration
<?php
namespace Common\Authentication\Options;
use Zend\Stdlib\AbstractOptions;
class Configuration extends AbstractOptions
{
/**
* Entity's class name
*
* @var string
*/
protected $identityClass;
/**
* Callable function to use in order to restrict what to store in the storage adapter
*
* @var mixed
*/
protected $identityCallable;
/**
* Callable function to check if a credential is valid
*
* @var mixed
*/
protected $credentialCallable;
/**
* Property to use for the identity
*
* @var string
*/
protected $identityProperty = 'username';
/**
* Property to use for the credential
*
* @var string
*/
protected $credentialProperty = 'password';
/**
* @param string $identityClass
* @return Configuration
*/
public function setIdentityClass($identityClass)
{
$this->identityClass = $identityClass;
return $this;
}
/**
* @return string
*/
public function getIdentityClass()
{
return $this->identityClass;
}
/**
* @param mixed $identityCallable
* @return Configuration
*/
public function setIdentityCallable($identityCallable)
{
$this->identityCallable = $identityCallable;
return $this;
}
/**
* @return mixed
*/
public function getIdentityCallable()
{
return $this->identityCallable;
}
/**
* @param mixed $credentialCallable
* @return Configuration
*/
public function setCredentialCallable($credentialCallable)
{
$this->credentialCallable = $credentialCallable;
return $this;
}
/**
* @return mixed
*/
public function getCredentialCallable()
{
return $this->credentialCallable;
}
/**
* @param string $identityProperty
* @return Configuration
*/
public function setIdentityProperty($identityProperty)
{
$this->identityProperty = $identityProperty;
return $this;
}
/**
* @return string
*/
public function getIdentityProperty()
{
return $this->identityProperty;
}
/**
* @param string $credentialProperty
* @return Configuration
*/
public function setCredentialProperty($credentialProperty)
{
$this->credentialProperty = $credentialProperty;
return $this;
}
/**
* @return string
*/
public function getCredentialProperty()
{
return $this->credentialProperty;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment