public static function find($ID = 0)
    {
        if (empty($ID) || !is_numeric($ID) || $ID <= 0) {
            return null;
        }
        global $wpdb;
        $calledClass = get_called_class();
        // Remove the Knob as possible prefix from called_class
        if (0 === strpos($calledClass, 'Knob\\')) {
            $calledClass = substr($calledClass, strpos($calledClass, '\\') + 1);
        }
        $sql = 'SELECT * FROM ' . static::getTableName() . ' WHERE ' . static::$PK . '= %d';
        if (!$row = $wpdb->get_row($wpdb->prepare($sql, $ID))) {
            return null;
        }

        $new = new $calledClass();
        foreach ($row as $column => $val) {
            $new->$column = $val;
        }

        return $new;
    }
public static function find($ID = 0)
    {
        if (empty($ID) || !is_numeric($ID) || $ID <= 0) {
            return null;
        }
        global $wpdb;
        $calledClass = get_called_class();
        // Remove the Knob as possible prefix from called_class
        if (0 === strpos($calledClass, 'Knob\\')) {
            $calledClass = substr($calledClass, strpos($calledClass, '\\') + 1);
        }
        $sql = 'SELECT * FROM ' . static::getTableName() . ' WHERE ' . static::$PK . '= %d';
        if (!$row = $wpdb->get_row($wpdb->prepare($sql, $ID))) {
            return null;
        }

        $new = new $calledClass();
        foreach ($row as $column => $val) {
            $new->$column = $val;
        }

        return $new;
    }
public static function find ( $ ID = 0 ) { if ( empty ( $ ID ) || ! is_numeric ( $ ID ) || $ ID <= 0 ) { return null ; } global $ wpdb ; $ calledClass = get_called_class ( ) ; // Remove the Knob as possible prefix from called_class if ( 0 === strpos ( $ calledClass , 'Knob\\' ) ) { $ calledClass = substr ( $ calledClass , strpos ( $ calledClass , '\\' ) + 1 ) ; } $ sql = 'SELECT * FROM ' . static :: getTableName ( ) . ' WHERE ' . static :: $ PK . '= %d' ; if ( ! $ row = $ wpdb -> get_row ( $ wpdb -> prepare ( $ sql , $ ID ) ) ) { return null ; } $ new = new $ calledClass ( ) ; foreach ( $ row as $ column => $ val ) { $ new -> $ column = $ val ; } return $ new ; }
Search and return the Object across his ID

@param int $ID
@return ModelBase
Search and return the Object across his ID