8.4.2: how to join File table

Permalink
What should I join with in entity class to have the File table:
- Concrete\Core\File\File,
- Concrete\Core\File\Version,
- Concrete\Core\Entity\File\File or
- Concrete\Core\Entity\File\Version?

I want my class to remove an entry when a file is deleted from the database, e.g. in the File Manager.

How can I save the file in my table? When I save it like this for example:
use Concrete\Core\File\File;
* @ORM\OneToOne("Concrete\Core\Entity\File\File")
* @ORM\JoinColumn(name="file",referencedColumnName="fID",onDelete="CASCADE")
protected $file;
private function setFile($file)
...
$file = File::getByID($id);
$file->setFile($file);

it complains the Expected value is "Concrete\Core\Entity\File\File" but I got my own FileClass instead

linuxoid
 
linuxoid replied on at Permalink Reply
linuxoid
I get the following error:

Cannot delete or update a parent row: a foreign key constraint fails (CONSTRAINT `FK_428CEB3A8C9F3610` FOREIGN KEY (`file`) REFERENCES `files` (`fID`))

This seems to mean that I've imported files with the Importer, then I set the file object to the File Entity but it doesn't exist, so after importing files, where do they get saved in the DB, which entity?