public function createClassIdentity($className)
 {
     $className = ClassUtils::getRealClass($className);
     if (isset($this->classCache[$className])) {
         return $this->classCache[$className];
     }
     if (null !== ($this->classCache[$className] = $this->classRepository->findOneByName($className))) {
         return $this->classCache[$className];
     }
     $classClass = $this->classRepository->getClassName();
     return $this->classCache[$className] = new $classClass($className);
 }
 /**
  * @Given /^the following products should have no associations:$/
  * @param TableNode $table
  */
 public function theFollowingProductsShouldHaveNoAssociations(TableNode $table)
 {
     $productNames = array_column($table->getHash(), 'name');
     foreach ($productNames as $productName) {
         $product = $this->productRepository->findOneByName($productName);
         $associatedProducts = $this->getAssociatedProducts($product);
         \PHPUnit_Framework_Assert::assertEmpty($associatedProducts);
     }
 }