コード例 #1
0
 /**
  * @param array|mixed $id
  *
  * @return array
  * @throws MappingException
  */
 private function fixScalarId($id, $className)
 {
     if (is_array($id)) {
         return $id;
     }
     $id = (array) $id;
     $identifiers = $this->getClassMetadata($className)->getIdentifierFieldNames();
     if (count($id) !== count($identifiers)) {
         throw MappingException::invalidIdentifierStructure();
     }
     return array_combine($identifiers, (array) $id);
 }
コード例 #2
0
 /**
  * @param array|mixed $id
  *
  * @return array
  * @throws MappingException
  */
 protected function fixScalarId($id, ApiMetadata $metadata)
 {
     if (is_array($id)) {
         return $id;
     }
     $id = (array) $id;
     $identifiers = $metadata->getIdentifierFieldNames();
     if (count($id) !== count($identifiers)) {
         throw MappingException::invalidIdentifierStructure();
     }
     return array_combine($identifiers, (array) $id);
 }