/** * returns the file matching an external_key * * @param string $key the external key * @return file matching the external key * @author jochum */ public static function getFileByExternalKey($key) { // get id from file by uri $fileCriteria = new Criteria(); $fileCriteria->add(FilePeer::EXTERNAL_KEY, $key); $fileCriteria->addDescendingOrderByColumn(FilePeer::TRACK_ID); $file = FilePeer::doSelectOne($fileCriteria); //TODO: ? what about the cardinality of externalkey to file ? // $files = FilePeer::doSelect($fileCriteria); // $file=NULL; // foreach ($files as $key => $value) { // $file = $value; // } return $file; }