コード例 #1
0
 public function testChangeEntityMode()
 {
     $entityModel = $this->createEntityModel(self::TEST_ENTITY);
     $this->createRepositoryMock([$entityModel], [UnitOfWork::STATE_MANAGED, UnitOfWork::STATE_MANAGED]);
     $this->em->expects($this->once())->method('persist')->with($this->equalTo($entityModel));
     $this->em->expects($this->never())->method('flush');
     $result = $this->configModelManager->changeEntityMode(self::TEST_ENTITY, ConfigModelManager::MODE_HIDDEN);
     $this->assertTrue($result);
     $this->assertEquals(ConfigModelManager::MODE_HIDDEN, $this->configModelManager->getEntityModel(self::TEST_ENTITY)->getMode());
 }
コード例 #2
0
ファイル: ConfigManager.php プロジェクト: Maksold/platform
 /**
  * Changes a mode of an entity
  *
  * @param string $className
  * @param string $mode      Can be the value of one of ConfigModel::MODE_* constants
  *
  * @return bool TRUE if the type was changed; otherwise, FALSE
  */
 public function changeEntityMode($className, $mode)
 {
     return $this->modelManager->changeEntityMode($className, $mode);
 }