src/EntityDescriptor/User/AbstractUser.php
public static function checkForObject($data, $ref=null) {
		if( empty($data['email']) ) {
			return;//Nothing to check. Email is mandatory.
		}
		$where	= 'email LIKE '.static::formatValue($data['email']);
		$what	= 'email';
		if( !empty($data['name']) ) {
			$what	.= ', name';
			$where	.= ' OR name LIKE '.static::formatValue($data['name']);
		}
		$user = static::get(array(
			'what'		=> $what,
			'where'		=> $where,
			'output'	=> SQLAdapter::ARR_FIRST
		));
		if( !empty($user) ) {
			if( $user['email'] === $data['email'] ) {
				static::throwException("emailAlreadyUsed");
				
			} else {
				static::throwException("entryExisting");
			}
		}
	}
public static function checkForObject($data, $ref=null) {
		if( empty($data['email']) ) {
			return;//Nothing to check. Email is mandatory.
		}
		$where	= 'email LIKE '.static::formatValue($data['email']);
		$what	= 'email';
		if( !empty($data['name']) ) {
			$what	.= ', name';
			$where	.= ' OR name LIKE '.static::formatValue($data['name']);
		}
		$user = static::get(array(
			'what'		=> $what,
			'where'		=> $where,
			'output'	=> SQLAdapter::ARR_FIRST
		));
		if( !empty($user) ) {
			if( $user['email'] === $data['email'] ) {
				static::throwException("emailAlreadyUsed");
				
			} else {
				static::throwException("entryExisting");
			}
		}
	}
public static function checkForObject ( $ data , $ ref = null ) { if ( empty ( $ data [ 'email' ] ) ) { return ; //Nothing to check. Email is mandatory. } $ where = 'email LIKE ' . static :: formatValue ( $ data [ 'email' ] ) ; $ what = 'email' ; if ( ! empty ( $ data [ 'name' ] ) ) { $ what .= ', name' ; $ where .= ' OR name LIKE ' . static :: formatValue ( $ data [ 'name' ] ) ; } $ user = static :: get ( array ( 'what' => $ what , 'where' => $ where , 'output' => SQLAdapter :: ARR_FIRST ) ) ; if ( ! empty ( $ user ) ) { if ( $ user [ 'email' ] === $ data [ 'email' ] ) { static :: throwException ( "emailAlreadyUsed" ) ; } else { static :: throwException ( "entryExisting" ) ; } } }
Check for object

@param $data The new data to process.
@param $ref The referenced object (update only). Default value is null.
@see create()
@see update()

This function is called by create() after checking user input data and before running for them.
In the base class, this method does nothing.
Check for object