コード例 #1
0
 public function findOthers($currentId, $currentName)
 {
     $currentName = StringUtils::camelCaseToLowDash($currentName);
     $currentPart = $this->filterPartName($currentName);
     $otherPart = $this->getOtherPartName($currentPart);
     $othersIds = $this->findOtherPartIds([$currentId], $currentPart);
     $otherManager = $this->getPartManager($otherPart);
     $items = $otherManager->findByIds($othersIds);
     return $items;
 }
コード例 #2
0
ファイル: Repository.php プロジェクト: deltaphp/deltadb
 public function loadUntrusted(EntityInterface &$entity, array $data, $id = null)
 {
     $data = ArrayUtils::renameKeys($data, function ($var) {
         return StringUtils::camelCaseToLowDash($var);
     });
     $id = $id ?: isset($data["id"]) ? $data["id"] : null;
     if ($id) {
         if ($this->getIdMap()->has($id)) {
             $entityHas = $this->getIdMap()->get($id);
             if ($entityHas->isTrusted()) {
                 $entity = $entityHas;
                 return $entity;
             }
         }
     }
     $entity->setUntrusted();
     $this->load($entity, $data);
     $this->getIdMap()->set($id, $entity);
     return $entity;
 }