TODO ArrayUtil 만들어서 이동 && method 설명 추가할 것
@param $obj
@param $result
549656
private static function normalizeSimpleXML($obj, &$result)
    {
        $data = $obj;
        if (is_object($data)) {
            $data = get_object_vars($data);
        }
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                $res = null;
                self::normalizeSimpleXML($value, $res);
                if (($key == '@attributes') && ($key)) {
                    $result = $res;
                } else {
                    $result[$key] = $res;
                }
            }
        } else {
            $result = $data;
        }
    }
1335237
public function generateNav ($result)
        {
            /**
             * @global object $navComponentObject
             */

            if ($this->arParams['DISPLAY_BOTTOM_PAGER'] === 'Y' || $this->arParams['DISPLAY_TOP_PAGER'] === 'Y')
            {
                $this->arResult['NAV_STRING'] = $result->GetPageNavStringEx (
                    $navComponentObject,
                    $this->arParams['PAGER_TITLE'],
                    $this->arParams['PAGER_TEMPLATE'],
                    $this->arParams['PAGER_SHOW_ALWAYS']
                );
                $this->arResult['NAV_CACHED_DATA'] = $navComponentObject->GetTemplateCachedData ();
                $this->arResult['NAV_RESULT'] = $result;
            }
        }
1128847
private function process(IdentResult &$result)
    {
        if (isset($result->person)) {
            foreach ($result->person as $p) {
                $attachments = $p->attachments;
                if (!empty($attachments)) {
                    foreach ($attachments as $attachment) {
                        $this->initMediaResource($attachment);
                    }
                }
            }
        }
    }
938419
static function drop($obj)
    {
        $tabela = strtolower(FuncoesReflections::pegaNomeClasseObjeto($obj));
        $atributosObjeto = FuncoesReflections::pegaAtributosDoObjeto($obj);
        $columnsTabela = self::columns($tabela);
        $arrayCamposTabela = [];
        for ($i = 0; $i < count($columnsTabela); $i++) {
            array_push($arrayCamposTabela, $columnsTabela[$i]['Field']);
        }
        
        $arrayDiff = array_diff($arrayCamposTabela, $atributosObjeto);
        $arrayDiff = array_values($arrayDiff);
        $sqlDrop = "ALTER TABLE $tabela \n";
        for ($j = 0; $j < count($arrayDiff); $j++) {
            if ($j != count($arrayDiff) - 1) {
                $sqlDrop .= "DROP " . $arrayDiff[$j] . ", ";
            } else {
                $sqlDrop .= "DROP " . $arrayDiff[$j] . ";";
            }
        }
        
        $contentFile = JsonReader::read(BASE_DIR."/phiber_config.json")->phiber->code_sync == 1 ? true : false;
        if ($contentFile) {
            $pdo = self::getConnection()->prepare($sqlDrop);
            if ($pdo->execute()) {
                return true;
            };

        } else {
            return $sqlDrop;
        }

        return false;
    }
748213
protected function _makeResult(array $result) {
        return Result::make($result, $this->getClient())->setModelClass($this->_fullModelClass());
    }
823343
public function search(Query $obj_query)
    {
        $obj_request = new SearchRequest();
        $obj_params = $this->prepareRequestParams($obj_request);

        // Basics
        $obj_params
            ->setQuery($obj_query->getQuery())
            ->setLimit($obj_query->getLimit())
            ->setOffset($obj_query->getOffset())
        ;

        // Sorting
        $arr_sorts = $obj_query->getSorts();
        if(null !== $arr_sorts && count($arr_sorts) > 0) {
            foreach ($arr_sorts as $arr_sort) {
                $obj_sort = $obj_params->addSortSpec();
                $obj_sort->setSortExpression($arr_sort[0]);
                $obj_sort->setSortDescending(Query::DESC === $arr_sort[1]);
            }
        }

        // Match Scoring
        if(Query::SCORE_REGULAR === $obj_query->getScorer()) {
            $obj_params->mutableScorerSpec()->setScorer(Scorer::MATCH_SCORER)->setLimit($obj_query->getLimit());
        } elseif (Query::SCORE_RESCORING === $obj_query->getScorer()) {
            $obj_params->mutableScorerSpec()->setScorer(Scorer::RESCORING_MATCH_SCORER)->setLimit($obj_query->getLimit());
        }

        // Return Fields
        $arr_return_fields = $obj_query->getReturnFields();
        if(null !== $arr_return_fields && count($arr_return_fields) > 0) {
            $obj_fields = $obj_params->mutableFieldSpec();
            foreach ($arr_return_fields as $str_field) {
                $obj_fields->addName($str_field);
            }
        }

        // Return Expressions
        $arr_return_exps = $obj_query->getReturnExpressions();
        if(null !== $arr_return_exps && count($arr_return_exps) > 0) {
            $obj_fields = $obj_params->mutableFieldSpec();
            foreach ($arr_return_exps as $arr_exp) {
                $obj_fields->addExpression()->setName($arr_exp[0])->setExpression($arr_exp[1]);
            }
        }

        // Facets
        $arr_facets = $obj_query->getFacets();
        if(null !== $arr_facets) {
            if(count($arr_facets) > 0) {
                // We want a specific set of facets in the response
                foreach($arr_facets as $str_facet) {
                    $obj_params->addIncludeFacet()->setName($str_facet);
                }
            } else {
                // We want all facets back...
                $obj_params->setAutoDiscoverFacetCount(100);
            }
        }

        $this->execute('Search', $obj_request, new SearchResponse());
        return $this->processSearchResponse();
    }
590530
protected function processResult($result)
    {
        $output = Helper::objectToArray($result);

        if (! is_array($output)) {
            throw new Error\Api($output);
        }

        if (isset($output['result'])) {
            return $output;
        }

        if (
            isset($output['request']) &&
            $output['request']['result'] != 1 &&
            $output['request']['result'] !== 'TRUE') {
            throw new Error\Api($output['request']['errorId'] . ' - ' . $output['request']['errorMessage']);
        }

        return $output;
    }
85063
function setResult( $result )
    {
        $this->Parameters['result'] = $result;
        $http = eZHTTPTool::instance();
        $http->setSessionVariable( 'ContentUploadParameters', $this->Parameters );
    }
129555
public function DeleteAll($obj)
	{
		$fms = $this->GetFieldMaps(get_class($obj));
		$pk = $obj->GetPrimaryKeyName();
		$table = $fms[$pk]->TableName;

		$sql = "delete from `$table`";
		$returnval = $this->DataAdapter->Execute($sql);
		$obj->OnDelete(); // fire OnDelete event
		return $returnval;

	}
924128
protected static function parseSetOf(&$data, &$result)
    {
        $data = self::parseCommon($data, $sequenceData);
        $result[] = [
            'set (' . self::$len . ')',
            self::parseASN((string) $sequenceData), ];
    }
523316
public static function invokeWithIocParams($obj, $method) {
        $method = new \ReflectionMethod(get_class($obj), $method);
        $args = [];
        if ($method->getNumberOfParameters() > 0) {
            $params = $method->getParameters();
            foreach ($params as $param) {
                $class = $param->getClass();
                if ($class) {
                    $className = $class->getName();
                    $bean = Ioc::get($className);
                    if (!$bean) {
                        $args[] = method_exists($className, 'instance') ? $className::instance() : new $className();
                    } else {
                        $args[] = $bean;
                    }
                } else {
                    $args[] = null;
                }
            }
        }
        $val = $method->invokeArgs($obj, $args);
        return $val;
    }
1025879
protected function makeObject(IResult $result) {

        // TODO: Prefer to return existing instance from IdentityMap

        $row = $result->fetchRow(ARRAY_ASSOC);
        if ($row === null)
            return null;
        return PersistableObject::populateNew($this->entityClass, $row);
    }
479174
protected function result(&$result)
    {
        if (!empty($this->options['json'])) {
            $this->jsonResult($result, $this->options['json'], true);
        }

        if (!empty($this->options['with_attr'])) {
            $this->getResultAttr($result, $this->options['with_attr']);
        }
    }
500890
public function dispatch(Controller $obj_controller)
    {
        $obj_controller->preDispatch();
        $obj_controller->dispatch();
        $obj_controller->postDispatch();
        $this->sendResponse($obj_controller->getResponse());
    }
26255
private function createEntityWithKey(\stdClass $obj_result)
    {
        if(isset($obj_result->entity->key->path)) {
            $arr_path = $obj_result->entity->key->path;

            // Key for 'self' (the last part of the KEY PATH)
            $obj_path_end = array_pop($arr_path);

            // Kind
            if(isset($obj_path_end->kind)) {
                if($obj_path_end->kind == $this->obj_schema->getKind()) {
                    $bol_schema_match = TRUE;
                    $obj_gds_entity = $this->obj_schema->createEntity();
                } else {
                    // Attempt to handle a non-schema-match
                    $bol_schema_match = FALSE;
                    $obj_gds_entity = (new \GDS\Entity())->setKind($obj_path_end->kind);
                }
            } else {
                throw new \RuntimeException("No Kind for end(path) for Entity?");
            }

            // ID or Name
            if(isset($obj_path_end->id)) {
                $obj_gds_entity->setKeyId($obj_path_end->id);
            } elseif (isset($obj_path_end->name)) {
                $obj_gds_entity->setKeyName($obj_path_end->name);
            } else {
                throw new \RuntimeException("No KeyID or KeyName for Entity?");
            }

            // Ancestors?
            $int_path_elements = count($arr_path);
            if($int_path_elements > 0) {
                $arr_anc_path = [];
                foreach ($arr_path as $obj_kpe) {
                    $arr_anc_path[] = [
                        'kind' => $obj_kpe->kind,
                        'id' => isset($obj_kpe->id) ? $obj_kpe->id : null,
                        'name' => isset($obj_kpe->name) ? $obj_kpe->name : null
                    ];
                }
                $obj_gds_entity->setAncestry($arr_anc_path);
            }
        } else {
            throw new \RuntimeException("No path for Entity Key?");
        }

        // Return whether or not the Schema matched
        return [$obj_gds_entity, $bol_schema_match];
    }
318305
public function eventHandler($e, $obj)
    {
        if (method_exists($this, $e)) {
            call_user_func(array($this, $e), $e, $obj);
        }
    }
1148631
private void addResult(ValidationResult result) {
		if (result == null || result.count() == 0) {
			return;
		}
		this.results.add(result);
	}