The doctrine/orm
library is an object-relational mapper (ORM) that provides transparent persistence for PHP objects.
The DoctrineORMIntrospectionUsageFinder uses Doctrine ORM metadata and finds related entities to the resource you are about to delete.
With the following mapping :
<?php
/**
* @ORM\Entity()
*/
class Product
{
/**
* @ORM\ManyToOne(targetEntity="Product")
*/
public $soldWith;
/**
* @ORM\ManyToOne(targetEntity="Product")
* @ORM\JoinColumn(onDelete="CASCADE", nullable=true)
*/
public $parent;
/**
* @ORM\OneToOne(targetEntity="Product")
* @ORM\JoinColumn(onDelete="SET NULL", nullable=true)
*/
public $replaces;
/**
* @ORM\ManyToMany(targetEntity="Product")
*/
public $crossSell;
}
Asking for usages of a Product
instance can retrieve :
Product
the product is sold with of, withRelation::RESTRICT
link typeProduct
the product is parent of, withRelation::DELETE
link typeProduct
the product replaces, withRelation::UNLINK
link typeProduct
the product cross sells, withRelation::DELETE
link type
« README