public function unique_key_exists($value, $field)
	{
		$total = \DB::select(array(\DB::expr('COUNT(*)'), 'total_count'))
			->from($this->_table_name)
			->where($field, '=', $value)
			->where($this->_primary_key, '!=', $this->pk())
			->execute($this->_db)
			->get('total_count');

		return ($total == 0);
	}
public function unique_key_exists($value, $field)
	{
		$total = \DB::select(array(\DB::expr('COUNT(*)'), 'total_count'))
			->from($this->_table_name)
			->where($field, '=', $value)
			->where($this->_primary_key, '!=', $this->pk())
			->execute($this->_db)
			->get('total_count');

		return ($total == 0);
	}
public function unique_key_exists ( $ value , $ field ) { $ total = \ DB :: select ( array ( \ DB :: expr ( 'COUNT(*)' ) , 'total_count' ) ) -> from ( $ this -> _table_name ) -> where ( $ field , '=' , $ value ) -> where ( $ this -> _primary_key , '!=' , $ this -> pk ( ) ) -> execute ( $ this -> _db ) -> get ( 'total_count' ) ; return ( $ total == 0 ) ; }
Tests if a unique key value exists in the database.

@param   mixed  $value  the value to test
@param   string $field  field name
@return  boolean
Tests if a unique key value exists in the database .