mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-05 16:04:33 +02:00
Renamed the base DBElement classes to AbstractDBElement to comply with symfony recommendations.
This commit is contained in:
parent
da72f5b3ec
commit
594c694ee0
62 changed files with 203 additions and 203 deletions
|
@ -25,7 +25,7 @@ declare(strict_types=1);
|
|||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Attachments\AttachmentType;
|
||||
use App\Entity\Base\StructuralDBElement;
|
||||
use App\Entity\Base\AbstractStructuralDBElement;
|
||||
use App\Entity\Devices\Device;
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Footprint;
|
||||
|
@ -71,22 +71,22 @@ class DataStructureFixtures extends Fixture
|
|||
*/
|
||||
public function createNodesForClass(string $class, ObjectManager $manager): void
|
||||
{
|
||||
if (! new $class() instanceof StructuralDBElement) {
|
||||
if (! new $class() instanceof AbstractStructuralDBElement) {
|
||||
throw new InvalidArgumentException('$class must be a StructuralDBElement!');
|
||||
}
|
||||
|
||||
$table_name = $this->em->getClassMetadata($class)->getTableName();
|
||||
$this->em->getConnection()->exec("ALTER TABLE `${table_name}` AUTO_INCREMENT = 1;");
|
||||
|
||||
/** @var StructuralDBElement $node1 */
|
||||
/** @var AbstractStructuralDBElement $node1 */
|
||||
$node1 = new $class();
|
||||
$node1->setName('Node 1');
|
||||
|
||||
/** @var StructuralDBElement $node2 */
|
||||
/** @var AbstractStructuralDBElement $node2 */
|
||||
$node2 = new $class();
|
||||
$node2->setName('Node 2');
|
||||
|
||||
/** @var StructuralDBElement $node3 */
|
||||
/** @var AbstractStructuralDBElement $node3 */
|
||||
$node3 = new $class();
|
||||
$node3->setName('Node 3');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue