Example #1
0
	/**
	 * Compare two values as strings explictly.
	 * This is useful for numbers that need to behave like strings, ie: postal codes with their leading zeros.
	 *
	 * @param $val1
	 * @param $val2
	 *
	 * @deprecated 2013.09 Please use the namespaced function instead.
	 *
	 * @return boolean
	 */
	public static function CompareStrings($val1, $val2) {
		return \Core\compare_strings($val1, $val2);
	}
	public function testCompareStrings(){
		$this->assertTrue(!\Core\compare_strings(1234, '01234'));
		$this->assertTrue(!\Core\compare_strings('1234', '01234'));
		$this->assertTrue(\Core\compare_strings(1234, '1234'));
	}
	/**
	 * Check if this value has changed between the database and working copy.
	 *
	 * @return bool
	 */
	public function changed(){
		return !\Core\compare_strings($this->valueDB, $this->value);
	}