Summary of parseLayer

@param mixed $objLayer
@return array
357520
protected function parseOverlay($objOverlay) {

        $stringClass = $GLOBALS['con4gis']['stringClass'];
        $arrOverlayData = array();

        $arrOverlayData['id'] = $objOverlay->id;
        $arrOverlayData['pid'] = $objOverlay->pid;
        $arrOverlayData['name'] =  \Contao\Controller::replaceInsertTags($stringClass::decodeEntities($objOverlay->name));

        $arrOverlayData['provider'] = $objOverlay->provider;

        switch ($objOverlay->provider)
        {
            case "custom":
                /* this values work for the js-code */
                $arrOverlayData['provider'] = "osm";
                $arrOverlayData['style'] = "osm_custom";

                $arrOverlayData['urls'] = array();

                for ($intI=1; $intI<5; $intI++)
                {
                    $colName = "url" . $intI;
                    if ($objOverlay->$colName)
                    {
                        $arrOverlayData['urls'][] = str_replace("$", "", $objOverlay->$colName);
                    }
                }
                break;
            case 'wms':
                $arrOverlayData['url'] = $objOverlay->wms_url;

                $arrOverlayData['params'] = array();
                $arrOverlayData['params']['layers'] = $objOverlay->wms_params_layers;
                $arrOverlayData['params']['version'] = $objOverlay->wms_params_version;
                $arrOverlayData['params']['format'] = $objOverlay->wms_params_format;
                $arrOverlayData['params']['transparent'] = $objOverlay->wms_params_transparent ? true : false;
                $arrOverlayData['params']['srs'] = $objOverlay->wms_params_srs;
                $arrOverlayData['gutter'] = $objOverlay->wms_gutter;
                break;
            case 'owm':
                $arrOverlayData['url'] = 'http://maps.owm.io:'.$objOverlay->api_port.'/'; //ToDo Port kann sich ändern

                $arrOverlayData['app_id'] = $objOverlay->app_id;
                $arrOverlayData['api_key'] = $objOverlay->api_key;
                break;
        }
        $arrOverlayData['opacity']     = $objOverlay->opacity;
        $arrOverlayData['attribution'] = $objOverlay->attribution;


        return $arrOverlayData;

    }
130234
public function getFolderData($objLayer, $key=false, $folder=false, $count=0)
    {
        if (!$folder) {
            $folder = $this->getFolder($objLayer);
        }
        if (!$key) {
            $key =$objLayer->id;
        }
        $folderPath = realpath(TL_ROOT.'/'.$folder);
        $countFiles = 2050;
        
        if (is_dir($folderPath)) {
            $dict = scandir($folderPath);
            unset($dict[array_search('.', $dict)]);
            unset($dict[array_search('..', $dict)]);
            foreach ($dict as $value) {
//                $value = utf8_encode($value);
                $path = realpath(TL_ROOT."/".$folder."/".$value);
                if (is_dir($path)) {
                    $fileFolder = pathinfo($path);
                    $arrSubFolder = $this->getFolderContent($objLayer, $fileFolder, $key, $count);
                    $count += 1;
                    $data = $this->getFolderData($objLayer,  $arrSubFolder['id'], $folder."/".$value, $count);
                    if ($data) {
                        $arrSubFolder['childsCount'] = count($data);
                        $arrSubFolder['childs'] = $data;
                        $arrData[] = $arrSubFolder;
                    }
                } elseif (is_file($path)) {
                    $fileData = pathinfo($path);
                    $arrFile = $this->getFileContent($objLayer, $folder, $fileData, $key, $countFiles);
                    $countFiles += 2;
                    if($arrFile) {
                        $arrData[] = $arrFile;
                    }
                }
            }
            return $arrData;
        } else {
            return false;
        }
    }
827002
protected function objectToArray($obj)
    {
        if (!is_array($obj) && !is_object($obj)) {
            return $obj;
        }

        if (is_array($obj)) {
            return $obj;
        }

        if (is_object($obj)) {
            $obj = get_object_vars($obj);
        }

        return array_map([$this, 'objectToArray'], $obj);
    }
1326077
public function formatObject($oObj)
    {
        return [
            'id'         => $oObj->id,
            'first_name' => $oObj->first_name,
            'last_name'  => $oObj->last_name,
            'email'      => $oObj->email,
        ];
    }
96668
protected function parse_result( $response ) {
		if ( is_wp_error( $response ) ) {
			return (object) [
				'success' => false,
				'version' => false,
				'error'   => $response->get_error_code(),
				'message' => $response->get_error_message(),
			];
		} else {
			$result = json_decode( $response );
			if ( is_null( $result ) ) {
				return (object) [
					'success' => false,
					'version' => false,
					'error'   => '500',
					'message' => 'Parser Error',
				];
			} else {
				return $result;
			}
		}
	}
1020479
public static function ObjectToArray($obj,$fields=[])
    {
        if(is_object($obj)){
            if(empty($fields)){
                return get_object_vars($obj);
            }else{
                $array=[];
                foreach ($fields as $fd){
                    if(property_exists($obj, $fd)){
                        $array[$fd]=$obj->$fd;
                    }
                }
                return $array;
            }
        }
        return [];
    }
569367
protected function objectToArray($obj, $keepNullProperties = true)
    {
        $arr = array();
        $arrObj = is_object($obj) ? get_object_vars($obj) : $obj;
        foreach ($arrObj as $key => $val) {
            $val = (is_array($val) || is_object($val)) ? $this->objectToArray($val, $keepNullProperties) : $val;
            if ($keepNullProperties || $val !== null) {
                $val = ($val === null) ? $val = '' : $val;
                $arr[$key] = is_scalar($val) ? ((string) $val) : $val;
            }
        }
        return $arr;
    }
1313489
public function parser(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        $beanName = $objectAnnotation->getName();
        $beanName = empty($beanName) ? $className : $beanName;
        $scope    = Scope::SINGLETON;

        DefinitionCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue);

        return [$beanName, $scope, ""];
    }
1059020
public function summaryFields()
    {
        $summaryFields = parent::summaryFields();
        $summaryFields = array_merge(
            $summaryFields, array(
                'Title'       => _t('News.TITLE', 'Title'),
                'Author'      => _t('News.AUTHOR', 'Author'),
                'PublishFrom' => _t('News.PUBLISH', 'Publish from'),
                'Status'      => _t('News.STATUS', 'Status'),
            )
        );

        return $summaryFields;
    }
711622
public function getElements(Element $wrapper = null)
    {
        $elements = [];

        $label = $this->getLabelElement();

        if ($label instanceof Element) {
            $elements[] = $label;
        }

        $element = $this->getElement();

        if (!$element->getAttribute('id')) {
            $element->addAttribute('id', $this->getIdAttribute());
        }

        if (!$this->isValid()) {
            $element->addClass('is-invalid');
        }

        $elements[] = $element;

        if (!$this->isValid()) {
            $error = $this->getForm()->createInvalidElement();
            $error->setInnerText($this->getErrorMessage());
            $elements[] = $error;
        }

        return $elements;
    }
403512
public function toArray($ignore = [])
    {
        return [
            'siteId' => $this->getSiteId(),
            'pageId' => $this->getPageId(),
            'name' => $this->getName(),
            'author' => $this->getAuthor(),
            'createdDate' => $this->getCreatedDateString(\DateTime::ISO8601),
            'lastPublished' => $this->getLastPublishedString(\DateTime::ISO8601),
            'pageLayout' => $this->getPageLayout(),
            'siteLayoutOverride' => $this->getSiteLayoutOverride(),
            'pageTitle' => $this->getPageTitle(),
            'description' => $this->getDescription(),
            'keywords' => $this->getKeywords(),
            'pageType' => $this->getPageType(),
        ];
    }
432370
public function asArray($mixed): ?array
    {
        $data = $this->_simpleXml($mixed);
        return $data ? $this->_asArray($data) : null;
    }
354006
public function Parse($parser = 'TextParser') {
        if($parser == 'TextParser' || is_subclass_of($parser, 'TextParser')) {
            $obj = Object::create($parser, $this->owner->value);
            return $obj->parse();
        } else {
            return $this->owner->Nice();
        }
    }
1280045
protected function parseChoice(ModelInterface $obj)
    {
        $label  = $this->renderObjPattern($obj);
        $choice = [
            'value' => $obj->id(),
            'label' => $label,
            'title' => $label
        ];

        /** @todo Move to {@see \Charcoal\Admin\Property\AbstractSelectableInput::choiceObjMap()} */
        if (is_callable([$obj, 'icon'])) {
            $choice['icon'] = $obj->icon();
        }

        return $choice;
    }
932185
public static function recursiveGetObjectVars($obj) {
		$arr = array();
		$_arr = is_object($obj) ? get_object_vars($obj) : $obj;

		foreach ($_arr as $key => $val) {
			$val = (is_array($val) || is_object($val)) ? self::recursiveGetObjectVars($val) : $val;

			// Transform boolean into 1 or 0 to make it safe across all Opauth HTTP transports
			if (is_bool($val)) $val = ($val) ? 1 : 0;

			$arr[$key] = $val;
		}

		return $arr;
	}
346721
protected function parseAsObjectActions(array $actions)
    {
        $objectActions = [];
        foreach ($actions as $action) {
            $action = $this->parseActionRenderables($action, true);

            if (isset($action['ident'])) {
                if ($action['ident'] === 'view' && !$this->isObjViewable()) {
                    $action['active'] = false;
                } elseif ($action['ident'] === 'create' && !$this->isObjCreatable()) {
                    $action['active'] = false;
                } elseif ($action['ident'] === 'edit' && !$this->isObjEditable()) {
                    $action['active'] = false;
                } elseif ($action['ident'] === 'delete' && !$this->isObjDeletable()) {
                    $action['active'] = false;
                }
            }

            if ($action['actions']) {
                $action['actions']    = $this->parseAsObjectActions($action['actions']);
                $action['hasActions'] = !!array_filter($action['actions'], function ($action) {
                    return $action['active'];
                });
            }

            $objectActions[] = $action;
        }

        return $objectActions;
    }
845375
public function serialiseResult($executionResult)
    {
        // Format object
        if (!empty($executionResult->errors)) {
            return [
                'data' => $executionResult->data,
                'errors' => array_map($this->errorFormatter, $executionResult->errors),
            ];
        } else {
            return [
                'data' => $executionResult->data,
            ];
        }
    }