Ejemplo n.º 1
0
 private function parseObject($objName, $objectAttribtues)
 {
     $object = new IndexableObject($objName);
     if (isset($objectAttribtues["indexId"])) {
         $object->setIndexId($objectAttribtues["indexId"]);
     }
     if (isset($objectAttribtues["objectId"])) {
         $object->setObjectId($objectAttribtues["objectId"]);
     }
     if (isset($objectAttribtues["id"])) {
         $object->setId($objectAttribtues["id"]);
     }
     if (isset($objectAttribtues["peerName"])) {
         $object->setPeerName($objectAttribtues["peerName"]);
     } else {
         $object->setPeerName($objName . "Peer");
     }
     if (isset($objectAttribtues["indexName"])) {
         $object->setIndexName($objectAttribtues["indexName"]);
     } else {
         $indexName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $objName));
         $object->setIndexName($indexName);
     }
     $this->searchableObjects[$objName] = $object;
 }
Ejemplo n.º 2
0
 protected function parseObject($objName, $objectAttribtues)
 {
     $object = new IndexableObject($objName);
     if (isset($objectAttribtues["indexId"])) {
         $object->setIndexId($objectAttribtues["indexId"]);
     }
     if (isset($objectAttribtues["objectId"])) {
         $object->setObjectId($objectAttribtues["objectId"]);
     }
     if (isset($objectAttribtues["id"])) {
         $object->setId($objectAttribtues["id"]);
     }
     if (isset($objectAttribtues["peerName"])) {
         $object->setPeerName($objectAttribtues["peerName"]);
     } else {
         $object->setPeerName($objName . "Peer");
     }
     if (isset($objectAttribtues["indexName"])) {
         $object->setIndexName($objectAttribtues["indexName"]);
     } else {
         $indexName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $objName));
         $object->setIndexName($indexName);
     }
     if (isset($objectAttribtues["apiName"])) {
         $apiName = (string) $objectAttribtues["apiName"];
         $apiName = preg_replace('/_(.?)/e', "strtoupper('\$1')", $apiName);
         $object->setApiName($apiName);
     }
     $this->searchableObjects[$objName] = $object;
 }