本文整理汇总了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();
}