$platformArray[] = $platformID; ################################################################# // PUBLISHER // Query to see if the Publisher already exists, if so, get the ID ################################################################# //check it against the previous row - no need to do another lookup if we've already figured out the platform //strip out double quotes $publisherName = trim(str_replace('"', '', $publisherName)); if ($publisherName == "") { $publisherName = $holdPublisher; } if ($publisherID == NULL || $publisherName != $holdPublisher) { //get the publisher object $publisherTestObj = new Publisher(); $publisherObj = new Publisher(); $publisherObj = $publisherTestObj->getByName($publisherName); if (is_object($publisherObj)) { $publisherID = $publisherObj->publisherID; } } //If it does not already exist, insert it and get the new ID if ($publisherID == '' && $publisherName) { $publisher = new Publisher(); $publisher->publisherID = ''; $publisher->name = $publisherName; try { $publisher->save(); } catch (Exception $e) { echo $e->getMessage(); } $publisherID = $publisher->primaryKey;