<?php
$query = $this->getQueryBuilder()
->insert('files_table')
'name' => '?',
'format' => '?',
)
);
$preparedQuery = $this->getPreparedQuery($query);
$query->bindValue(1, $fileName);
$query->bindValue(2, $format);
try {
return $query->execute();
}
PD9waHAKICAgICRxdWVyeSA9ICR0aGlzLT5nZXRRdWVyeUJ1aWxkZXIoKQogICAgICAgIC0+aW5zZXJ0KCdmaWxlc190YWJsZScpCiAgICAgICAgLT52YWx1ZXMoYXJyYXkoCiAgICAgICAgICAgICduYW1lJyAgID0+ICc/JywKICAgICAgICAgICAgJ2Zvcm1hdCcgPT4gJz8nLAogICAgICAgICAgICApCiAgICAgICAgKTsKCiAgICAkcHJlcGFyZWRRdWVyeSA9ICR0aGlzLT5nZXRQcmVwYXJlZFF1ZXJ5KCRxdWVyeSk7CiAgICAkcXVlcnktPmJpbmRWYWx1ZSgxLCAkZmlsZU5hbWUpOwogICAgJHF1ZXJ5LT5iaW5kVmFsdWUoMiwgJGZvcm1hdCk7CgogICAgdHJ5IHsKICAgICAgICByZXR1cm4gJHF1ZXJ5LT5leGVjdXRlKCk7CiAgICB9IA==