本文整理匯總了PHP中Symfony\Component\HttpFoundation\File\File::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP File::getName方法的具體用法?PHP File::getName怎麽用?PHP File::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\HttpFoundation\File\File
的用法示例。
在下文中一共展示了File::getName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: files
/**
* Retrieves the attachments of the specified object
*
* @param mixed $object
* @return WebDev\AttachmentBundle\Attachement\File[]
*/
public function files($object)
{
if (!is_object($object)) {
throw new Exception("Can't retrieve the attachments of a " . get_type($object));
}
$class = new ReflectionClass($object);
$files = array();
foreach ($this->reader->getClassAnnotations($class) as $annotation) {
if (!$annotation instanceof FileAttachment) {
continue;
}
$file = new File($annotation, $object, $this);
$files[$file->getName()] = $file;
}
return $files;
}
示例2: getName
/**
* Returns the absolute file name without dots.
*
* @return string The file path
*/
public function getName()
{
return $this->moved ? parent::getName() : $this->originalName;
}
示例3: getName
/**
* Returns the absolute file name without dots
*
* Until the uploaded file is moved, it will return the name of the temporary file
*
* @returns string The file path
*/
public function getName()
{
if (!$this->moved) {
return $this->originalName;
}
return parent::getName();
}