DBEntity::reload PHP Method

reload() public method

Get latest values
public reload ( )
    public function reload()
    {
        $schema = static::schema();
        $pkValue = $this->{$schema['pk']};
        if (is_string($pkValue)) {
            $pkValue = safeSQLString($pkValue);
        }
        $result = DBEntity::query('SELECT * FROM ' . $this->table() . ' WHERE ' . $schema['pk'] . ' = ' . $pkValue);
        if ($result == false) {
            return false;
        }
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        $this->init($row);
        return true;
    }