Ejemplo n.º 1
0
	/**
	* Describes the schema and validation rules for this object.  This is auto-generated.
	*/
	protected function describe()
	{
	    parent::describe();

	    // create validators for columns
	    $this->validators["provider_id"]=array(
		RequiredValidator::Create("provider_id is required.")
	    );
	    $this->validators["name"]=array(
		RequiredValidator::Create("name is required.")
	    );

	    // create relations for columns
	    $this->related['inventory']=new Relation($this,'inventory',Relation::RELATION_MANY,'provider.inventory','account_id');
	    $this->related['keys']=new Relation($this,'keys',Relation::RELATION_MANY,'provider.keys','account_id');
	    $this->related['provider']=new Relation($this,'provider',Relation::RELATION_SINGLE,'provider.provider','id','provider_id');
	}
Ejemplo n.º 2
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return AccountPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new AccountPeer();
     }
     return self::$peer;
 }
Ejemplo n.º 3
0
 public function getClearingNumber()
 {
     return parent::getClearingNumber() ?: '0000';
 }
Ejemplo n.º 4
0
 public function getSerialNumber()
 {
     return str_replace('-', '', parent::getSerialNumber());
 }
Ejemplo n.º 5
0
 public function setUp()
 {
     parent::setUp();
     $this->hasMutator('password', 'passwordMutator');
 }