public static function find_or_create($type, $authenticator, $domain=null)
	{
		$query = self::all()
			->whereEquals('type', $type)
			->whereEquals('authenticator', $authenticator);
		if ($domain)
		{
			$query->whereEquals('domain', $domain);
		}
		$row = $query->row();

		if (!$row || !$row->get('id'))
		{
			$row = self::blank();
			$row->set('type', $type);
			$row->set('authenticator', $authenticator);
			if ($domain)
			{
				$row->set('domain', $domain);
			}
			$row->save();
		}

		if (!$row->get('id'))
		{
			return false;
		}

		return $row;
	}
public static function find_or_create($type, $authenticator, $domain=null)
	{
		$query = self::all()
			->whereEquals('type', $type)
			->whereEquals('authenticator', $authenticator);
		if ($domain)
		{
			$query->whereEquals('domain', $domain);
		}
		$row = $query->row();

		if (!$row || !$row->get('id'))
		{
			$row = self::blank();
			$row->set('type', $type);
			$row->set('authenticator', $authenticator);
			if ($domain)
			{
				$row->set('domain', $domain);
			}
			$row->save();
		}

		if (!$row->get('id'))
		{
			return false;
		}

		return $row;
	}
public static function find_or_create ( $ type , $ authenticator , $ domain = null ) { $ query = self :: all ( ) -> whereEquals ( 'type' , $ type ) -> whereEquals ( 'authenticator' , $ authenticator ) ; if ( $ domain ) { $ query -> whereEquals ( 'domain' , $ domain ) ; } $ row = $ query -> row ( ) ; if ( ! $ row || ! $ row -> get ( 'id' ) ) { $ row = self :: blank ( ) ; $ row -> set ( 'type' , $ type ) ; $ row -> set ( 'authenticator' , $ authenticator ) ; if ( $ domain ) { $ row -> set ( 'domain' , $ domain ) ; } $ row -> save ( ) ; } if ( ! $ row -> get ( 'id' ) ) { return false ; } return $ row ; }
Fine a specific record, or create it
if not found

@param   string  $type
@param   string  $authenticator
@param   string  $domain
@return  mixed
Fine a specific record or create it if not found