function get_by_id($id, $ammend_query = '')
	{
		if (isset(self::$_cache[$this->_table][$id])) {
			//var_dump(self::$_cache[$this->_table][$id]);
			return self::$_cache[$this->_table][$id];
		}

		$q = \Fw\Db::prepare("select * from " . $this->_table . " where id=? " . $ammend_query);
		$q->execute(array($id));
		$res = $q->fetchObject($this->_entity);
		self::$_cache[$this->_table][$id] = $res;

		return $res;
	}