本文整理汇总了PHP中core_kernel_classes_Class::getUniquePropertyValue方法的典型用法代码示例。如果您正苦于以下问题:PHP core_kernel_classes_Class::getUniquePropertyValue方法的具体用法?PHP core_kernel_classes_Class::getUniquePropertyValue怎么用?PHP core_kernel_classes_Class::getUniquePropertyValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_kernel_classes_Class
的用法示例。
在下文中一共展示了core_kernel_classes_Class::getUniquePropertyValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* (non-PHPdoc)
*
* @see \oat\tao\model\media\MediaManagement::delete
*/
public function delete($link)
{
$instance = new \core_kernel_classes_Class(\tao_helpers_Uri::decode($link));
$fileLink = $instance->getUniquePropertyValue(new \core_kernel_classes_Property(MEDIA_LINK));
$fileLink = $fileLink instanceof \core_kernel_classes_Resource ? $fileLink->getUri() : (string) $fileLink;
$instance->delete();
$fileManager = FileManager::getFileManagementModel();
$deleted = $fileManager->deleteFile($fileLink);
return $deleted;
}
示例2: testEditMediaInstance
public function testEditMediaInstance()
{
$fileTmp = dirname(__DIR__) . '/sample/Italy.png';
$this->initializeMock($fileTmp);
$this->fileManagerMock->expects($this->once())->method('deleteFile')->with('MyLink')->willReturn(true);
$lang = 'EN-en';
$instanceUri = 'http://myFancyDomain.com/myGreatInstanceUri';
$instance = new \core_kernel_classes_Class($instanceUri);
$instance->setPropertyValue(new \core_kernel_classes_Property(MEDIA_LINK), 'MyLink');
$this->mediaService->editMediaInstance($fileTmp, $instanceUri, $lang);
$this->assertEquals($lang, $instance->getUniquePropertyValue(new \core_kernel_classes_Property(MEDIA_LANGUAGE)), 'The instance language is wrong');
// remove what has been done
$inst = new \core_kernel_classes_Resource($instanceUri);
$inst->delete();
}