protected function method() { if (Builder::get()) { } $code = array_map(function ($line) { return $line ? ' ' . $line : $line; }, explode("\n", $code)); return sprintf("if (%s)\n{\n%s}\n", implode(' && ', $conditions), $code); }
/** * Gets results from prepared query * * @return null */ private function getResult() { $this->result_object = $this->query->get(); if ($this->query_type == 'builder') { $this->result_array = array_map(function ($object) { return (array) $object; }, $this->result_object); } else { $this->result_array = array_map(function ($object) { return (array) $object; }, $this->result_object->toArray()); } }
/** * Call WordPress function to add the menu page. */ public function add_menu() { add_submenu_page($this->parent->get('slug'), $this->page_title, $this->title, $this->capability, $this->slug, [$this, 'callback']); }