public function populate(DbManagement $db, DbManagementObject $DbManagementObject, $query)
    {         
        $keys = array_values($DbManagementObject->getKeys());
        $db->add($query, $keys);
        $array = array_values($DbManagementObject->getValues());
        $db->query($query, $array);
        return $db->lastInsertId();
    }
public function populate(DbManagement $db, DbManagementObject $DbManagementObject, $query)
    {         
        $keys = array_values($DbManagementObject->getKeys());
        $db->add($query, $keys);
        $array = array_values($DbManagementObject->getValues());
        $db->query($query, $array);
        return $db->lastInsertId();
    }
public function populate ( DbManagement $ db , DbManagementObject $ DbManagementObject , $ query ) { $ keys = array_values ( $ DbManagementObject -> getKeys ( ) ) ; $ db -> add ( $ query , $ keys ) ; $ array = array_values ( $ DbManagementObject -> getValues ( ) ) ; $ db -> query ( $ query , $ array ) ; return $ db -> lastInsertId ( ) ; }
add an Object to the table in the database
@param DbManagement $db                          the database connector
@param DbManagementObject $DbManagementObject    the DbManagementObject containing all needed data to populate database
@param String $query                             the query to populate database
@throws DataBaseException                        error in connecting to the database
@return id of the record
add an Object to the table in the database