{"id":289,"date":"2017-11-28T22:02:41","date_gmt":"2017-11-28T21:02:41","guid":{"rendered":"http:\/\/oliver-frick.ch\/?p=289"},"modified":"2017-11-28T22:02:41","modified_gmt":"2017-11-28T21:02:41","slug":"ldapdto-helper","status":"publish","type":"post","link":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/2017\/11\/28\/ldapdto-helper\/","title":{"rendered":"LdapDTO Helper"},"content":{"rendered":"<p><?php\n\/*\n* To change this license header, choose License Headers in Project Properties.\n* To change this template file, choose Tools | Templates\n* and open the template in the editor.\n*\/\nnamespace AppBundle;\n\/**\n* Description of LdapDTO\n*\n* @author oliver\n*\/\nclass LdapDTO extends BaseDTO {\npublic function setData($array) {\n$entry = $array[0];\nfor ($i = 0; $i < $entry[\u2018count\u2019]; $i++) {\n$attribute = $entry[$i];\n$ucattribute = strtoupper($attribute);\nif ($entry[$attribute][\u2018count\u2019] == 1) {\n$retEntry[$attribute] = $entry[$attribute][0];\n$this->$ucattribute = $entry[$attribute][0];<br \/>\n} else {<br \/>\nfor ($j = 0; $j < $entry[$attribute][\u2018count\u2019]; $j++) {\n$retEntry[$attribute][] = $entry[$attribute][$j];\n}\n$this->$ucattribute = $retEntry[$attribute];<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\n\/\/ undefined attributes are requested here<br \/>\npublic function __get($name) {<br \/>\nreturn null;<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=289"}],"version-history":[{"count":1,"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":290,"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/289\/revisions\/290"}],"wp:attachment":[{"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oliver-frick.ch\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}