public function checkAvailability($fieldname, $value, $currentid = 0)
    {
        foreach ($this->users as $user) {
            if (($this->canonicalizeFieldValue($fieldname, $user[$fieldname]) ===
                 $this->canonicalizeFieldValue($fieldname, $value)) &&
                ($user['id'] != $currentid)
            ) {
                return false;
            }
        }

        // no clashes found, OK!
        return true;
    }
public function checkAvailability($fieldname, $value, $currentid = 0)
    {
        foreach ($this->users as $user) {
            if (($this->canonicalizeFieldValue($fieldname, $user[$fieldname]) ===
                 $this->canonicalizeFieldValue($fieldname, $value)) &&
                ($user['id'] != $currentid)
            ) {
                return false;
            }
        }

        // no clashes found, OK!
        return true;
    }
public function checkAvailability ( $ fieldname , $ value , $ currentid = 0 ) { foreach ( $ this -> users as $ user ) { if ( ( $ this -> canonicalizeFieldValue ( $ fieldname , $ user [ $ fieldname ] ) === $ this -> canonicalizeFieldValue ( $ fieldname , $ value ) ) && ( $ user [ 'id' ] != $ currentid ) ) { return false ; } } // no clashes found, OK! return true ; }
Check if a certain field with a certain value doesn't exist already.
Depending on the field type, different pre-massaging of the compared
values are applied, because what constitutes 'equal' for the purpose
of this filtering depends on the field type.

@param string $fieldname
@param string $value
@param int    $currentid

@return bool
Check if a certain field with a certain value doesn t exist already . Depending on the field type different pre - massaging of the compared values are applied because what constitutes equal for the purpose of this filtering depends on the field type .