Ejemplo n.º 1
0
 public function directoryName($object, PropertyMapping $mapping)
 {
     if ($object instanceof Document) {
         return Helper::codau2khongdau($this->getParentPath($object->getCategoryId()), true);
     } elseif ($object instanceof Project) {
         return Helper::codau2khongdau($this->getParentPath($object->getCategory()) . $object->getName(), true);
     }
     return '';
 }
Ejemplo n.º 2
0
 protected function getUploadDir()
 {
     // get rid of the __DIR__ so it doesn't screw up
     // when displaying uploaded doc/image in the view.
     $category = $this->getCategoryId();
     $path = $category->getName();
     while (null !== $category->getParent() && $category->getParent()->getName() != '') {
         $category = $category->getParent();
         $path = $category->getName() . '/' . $path;
     }
     return 'documents/' . Helper::codau2khongdau($path);
 }