本文整理汇总了PHP中Doctrine\ORM\EntityManager::getClassMetaData方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityManager::getClassMetaData方法的具体用法?PHP EntityManager::getClassMetaData怎么用?PHP EntityManager::getClassMetaData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\EntityManager
的用法示例。
在下文中一共展示了EntityManager::getClassMetaData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->artisan('doctrine:schema:create');
$this->em = $this->app->make(EntityManager::class);
$this->repository = new DoctrineUserRepository($this->em, $this->em->getClassMetaData(User::class));
}
示例2: updateProgramYearSteward
/**
* @param ProgramYearStewardInterface $programYearSteward
* @param bool $andFlush
* @param bool $forceId
*/
public function updateProgramYearSteward(ProgramYearStewardInterface $programYearSteward, $andFlush = true, $forceId = false)
{
$this->em->persist($programYearSteward);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($programYearSteward));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例3: updateCurriculumInventoryAcademicLevel
/**
* @param CurriculumInventoryAcademicLevelInterface $curriculumInventoryAcademicLevel
* @param bool $andFlush
* @param bool $forceId
*/
public function updateCurriculumInventoryAcademicLevel(CurriculumInventoryAcademicLevelInterface $curriculumInventoryAcademicLevel, $andFlush = true, $forceId = false)
{
$this->em->persist($curriculumInventoryAcademicLevel);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($curriculumInventoryAcademicLevel));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例4: updateCurriculumInventorySequenceBlockSession
/**
* @param CurriculumInventorySequenceBlockSessionInterface $curriculumInventorySequenceBlockSession
* @param bool $andFlush
* @param bool $forceId
*/
public function updateCurriculumInventorySequenceBlockSession(CurriculumInventorySequenceBlockSessionInterface $curriculumInventorySequenceBlockSession, $andFlush = true, $forceId = false)
{
$this->em->persist($curriculumInventorySequenceBlockSession);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($curriculumInventorySequenceBlockSession));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例5: updateAlertChangeType
/**
* @param AlertChangeTypeInterface $alertChangeType
* @param bool $andFlush
* @param bool $forceId
*/
public function updateAlertChangeType(AlertChangeTypeInterface $alertChangeType, $andFlush = true, $forceId = false)
{
$this->em->persist($alertChangeType);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($alertChangeType));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例6: updateAamcMethod
/**
* @param AamcMethodInterface $aamcMethod
* @param bool $andFlush
* @param bool $forceId
*/
public function updateAamcMethod(AamcMethodInterface $aamcMethod, $andFlush = true, $forceId = false)
{
$this->em->persist($aamcMethod);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($aamcMethod));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例7: updateSessionLearningMaterial
/**
* @param SessionLearningMaterialInterface $sessionLearningMaterial
* @param bool $andFlush
* @param bool $forceId
*/
public function updateSessionLearningMaterial(SessionLearningMaterialInterface $sessionLearningMaterial, $andFlush = true, $forceId = false)
{
$this->em->persist($sessionLearningMaterial);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($sessionLearningMaterial));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例8: updateMeshUserSelection
/**
* @param MeshUserSelectionInterface $meshUserSelection
* @param bool $andFlush
* @param bool $forceId
*/
public function updateMeshUserSelection(MeshUserSelectionInterface $meshUserSelection, $andFlush = true, $forceId = false)
{
$this->em->persist($meshUserSelection);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($meshUserSelection));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例9: updateMeshPreviousIndexing
/**
* @param MeshPreviousIndexingInterface $meshPreviousIndexing
* @param bool $andFlush
* @param bool $forceId
*/
public function updateMeshPreviousIndexing(MeshPreviousIndexingInterface $meshPreviousIndexing, $andFlush = true, $forceId = false)
{
$this->em->persist($meshPreviousIndexing);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($meshPreviousIndexing));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例10: updateReportPoValue
/**
* @param ReportPoValueInterface $reportPoValue
* @param bool $andFlush
* @param bool $forceId
*/
public function updateReportPoValue(ReportPoValueInterface $reportPoValue, $andFlush = true, $forceId = false)
{
$this->em->persist($reportPoValue);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($reportPoValue));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例11: updateInstructionHours
/**
* @param InstructionHoursInterface $instructionHours
* @param bool $andFlush
* @param bool $forceId
*/
public function updateInstructionHours(InstructionHoursInterface $instructionHours, $andFlush = true, $forceId = false)
{
$this->em->persist($instructionHours);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($instructionHours));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例12: updateUserMadeReminder
/**
* @param UserMadeReminderInterface $userMadeReminder
* @param bool $andFlush
* @param bool $forceId
*/
public function updateUserMadeReminder(UserMadeReminderInterface $userMadeReminder, $andFlush = true, $forceId = false)
{
$this->em->persist($userMadeReminder);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($userMadeReminder));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例13: updateCohort
/**
* @param CohortInterface $cohort
* @param bool $andFlush
* @param bool $forceId
*/
public function updateCohort(CohortInterface $cohort, $andFlush = true, $forceId = false)
{
$this->em->persist($cohort);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($cohort));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}
示例14: setUpBeforeClass
public static function setUpBeforeClass()
{
static::$kernel = static::createKernel();
static::$kernel->boot();
self::$em = static::$kernel->getContainer()->get('doctrine')->getManager();
self::$tool = new SchemaTool(self::$em);
self::$userClasses = [self::$em->getClassMetaData('Sulu\\Bundle\\TestBundle\\Entity\\TestContact'), self::$em->getClassMetaData('Sulu\\Bundle\\TestBundle\\Entity\\TestUser')];
self::$tool->dropSchema(self::$userClasses);
self::$tool->createSchema(self::$userClasses);
static::$kernel->getContainer()->set('sulu_security.user_repository', static::$kernel->getContainer()->get('test_user_provider'));
}
示例15: updateLearningMaterialUserRole
/**
* @param LearningMaterialUserRoleInterface $learningMaterialUserRole
* @param bool $andFlush
* @param bool $forceId
*/
public function updateLearningMaterialUserRole(LearningMaterialUserRoleInterface $learningMaterialUserRole, $andFlush = true, $forceId = false)
{
$this->em->persist($learningMaterialUserRole);
if ($forceId) {
$metadata = $this->em->getClassMetaData(get_class($learningMaterialUserRole));
$metadata->setIdGenerator(new AssignedGenerator());
}
if ($andFlush) {
$this->em->flush();
}
}