mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
- fix : forgotten type, uuid, sha etc
This commit is contained in:
@@ -1241,6 +1241,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
|||||||
return $story;
|
return $story;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param File $file
|
* @param File $file
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
@@ -1252,7 +1253,11 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
|||||||
{
|
{
|
||||||
$collection = $file->getCollection();
|
$collection = $file->getCollection();
|
||||||
|
|
||||||
$record = self::_create($collection, $app);
|
$record = self::_create(
|
||||||
|
$collection,
|
||||||
|
$app,
|
||||||
|
$file
|
||||||
|
);
|
||||||
if($record) {
|
if($record) {
|
||||||
$databox = $record->getDatabox();
|
$databox = $record->getDatabox();
|
||||||
|
|
||||||
@@ -1277,6 +1282,8 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* create a record without document
|
||||||
|
*
|
||||||
* @param collection $collection
|
* @param collection $collection
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
*
|
*
|
||||||
@@ -1296,11 +1303,11 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
|||||||
/**
|
/**
|
||||||
* @param collection $collection
|
* @param collection $collection
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
*
|
* @param File|null $file
|
||||||
* @return record_adapter|null
|
* @return record_adapter|null
|
||||||
* @throws DBALException
|
* @throws DBALException
|
||||||
*/
|
*/
|
||||||
private static function _create(collection $collection, Application $app)
|
private static function _create(collection $collection, Application $app, File $file=null)
|
||||||
{
|
{
|
||||||
$databox = $collection->get_databox();
|
$databox = $collection->get_databox();
|
||||||
|
|
||||||
@@ -1314,11 +1321,11 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
|||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
':coll_id' => $collection->get_coll_id(),
|
':coll_id' => $collection->get_coll_id(),
|
||||||
':parent_record_id' => 0,
|
':parent_record_id' => 0,
|
||||||
':type' => 'unknown',
|
':type' => $file ? ($file->getType() ? $file->getType()->getType() : 'unknown') : null,
|
||||||
':sha256' => null,
|
':sha256' => $file ? $file->getMedia()->getHash('sha256') : null,
|
||||||
':uuid' => null,
|
':uuid' => $file ? $file->getUUID(true) : null,
|
||||||
':originalname' => null,
|
':originalname' => $file ? $file->getOriginalName() : null,
|
||||||
':mime' => null,
|
':mime' => $file ? $file->getFile()->getMimeType() : null,
|
||||||
]);
|
]);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user