Collections\Controller\Collections::entry PHP Метод

entry() публичный Метод

public entry ( $collectionId, $entryId = null )
    public function entry($collectionId, $entryId = null)
    {
        $collection = $this->app->db->findOne("common/collections", ["_id" => $collectionId]);
        $entry = null;
        if (!$collection) {
            return false;
        }
        if ($entryId) {
            $col = "collection" . $collection["_id"];
            $entry = $this->app->db->findOne("collections/{$col}", ["_id" => $entryId]);
            if (!$entry) {
                return false;
            }
        }
        $locales = $this->app->db->getKey("cockpit/settings", "cockpit.locales", []);
        return $this->render("collections:views/entry.php", compact('collection', 'entry', 'locales'));
    }