本文整理汇总了PHP中Entry类的典型用法代码示例。如果您正苦于以下问题:PHP Entry类的具体用法?PHP Entry怎么用?PHP Entry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Entry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: entryLedgers
/**
* Show the entry ledger details
*/
function entryLedgers($id)
{
/* Load the Entry model */
App::import("Webzash.Model", "Entry");
$Entry = new Entry();
return $Entry->entryLedgers($id);
}
示例2: performHandlerTasks
public function performHandlerTasks()
{
if (($author_id = Application::param('author_id')) && ($entry_id = Application::param('entry_id'))) {
$entry = new Entry();
$entry->clauseSafe('author_id', $author_id);
$entry->clauseSafe('entry_id', $entry_id);
$this->entry_to_manage_for = $entry;
} else {
$this->redirectOnAccessDenied();
}
if (!LogbookAccess::currentUserCanManageAccess($this->entryToManageFor())) {
$this->redirectOnAccessDenied();
}
if ($group_id = Application::param('group_id')) {
$this->group_to_manage_for = new Group();
$this->group_to_manage_for->clauseSafe('group_id', $group_id);
}
if (Application::formPosted()) {
if (Application::param('choose_group')) {
$this->chooseGroup();
}
if (Application::param('manage_access')) {
$this->manageAccess();
}
}
}
示例3: indexAction
public function indexAction()
{
$entries = new Entry();
// test memcached
if (extension_loaded('memcache')) {
$mem = new Memcache();
$mem->addServer('localhost', 11211);
$result = $mem->get('indexContent');
if (!$result) {
$result = $entries->fetchLatest(100);
$mem->set('indexContent', $result, 0, 4);
}
} else {
$result = $entries->fetchLatest(100);
}
if ($result) {
$this->view->entries = $result;
// Zend_Paginator
$page = $this->_request->getParam('page', 1);
$paginator = Zend_Paginator::factory($result);
$paginator->setItemCountPerPage(4);
$paginator->setCurrentPageNumber($page);
$this->view->paginator = $paginator;
}
}
示例4: add
public function add(Entry $entry)
{
if (!$entry instanceof Entry) {
throw InvalidArgumentException('引数の型が不正です');
}
$this->directory[] = $entry;
$entry->setParent($this);
}
示例5: addEntry
public function addEntry($data, $program)
{
$entry = new Entry();
$entry->fromData($data, $program);
array_push($this->entries, $entry);
writeLog('Loaded entry for program ' . $program->id . ' (', $program->year . ')');
return $entry;
}
示例6: postAdd
public function postAdd($p, $z)
{
// update Zoop::Form so that it it can handle consolidating the edit and view pages here
$entry = new Entry();
$entry->start = $_POST['start'];
$entry->end = $_POST['end'];
$entry->title = $_POST['title'];
$entry->is_duration = isset($_POST['is_duration']) && $_POST['is_duration'] ? 1 : 0;
$entry->save();
$this->redirect('');
}
示例7: importEntry
public static function importEntry($path)
{
$parts = explode('/', $path);
$info = explode('_', $parts[count($parts) - 2]);
// do the database part
$entry = new Entry((int) $info[0]);
$entry->name = $info[1];
$entry->assignHeaders();
$entry->save();
// do the file system part
$entry->cacheContent();
}
示例8: getTags
function getTags(Entry $entry)
{
$sql = "SELECT tags.id_tag as id, tags.tag_text\n\t\t\t\tFROM entry2tag\n\t\t\t\tINNER JOIN tags\n\t\t\t\tON entry2tag.id_tag = tags.id_tag\n\t\t\t\tWHERE entry2tag.id_entry = :id";
try {
$query = $this->db->prepare($sql);
$query->execute(array(':id' => $entry->getId()));
} catch (PDOException $e) {
return $e->getMessage();
}
$tags = $query->fetchAll(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, "Tag");
$entry->setTags($tags);
}
示例9: importEntry
public static function importEntry($path)
{
$info = self::parsePath($path);
// do the database part
$entry = new Entry((int) $info['id']);
$entry->name = $info['name'];
$entry->simple = $info['simple'];
$entry->assignHeaders();
$entry->save();
// do the file system part
$entry->cacheContent();
}
示例10: entry_count
public function entry_count()
{
$child_class = $this->class === 'category' ? 'entry' : 'page';
$blog_id = $this->blog_id;
$cat_id = $this->id;
$where = "entry_status = 2\n and entry_class = '{$child_class}'\n and entry_blog_id = {$blog_id}";
$join = array();
$join['mt_placement'] = array('condition' => "placement_entry_id = entry_id and placement_category_id = {$cat_id}");
require_once 'class.mt_entry.php';
$entry = new Entry();
$cnt = $entry->count(array('where' => $where, 'join' => $join));
return $cnt;
}
示例11: createPayload
/**
* Create the view payload
* @param \mdref\Entry $ref
* @param \mdref\Generator\Renderer $view
* @return \stdClass
*/
private function createPayload(Entry $ref = null)
{
$pld = new \stdClass();
$pld->quick = [$this->reference, "formatString"];
$pld->file = [$this->reference, "formatFile"];
$pld->refs = $this->reference;
$pld->view = $this->renderer;
if ($ref) {
$pld->entry = $ref;
$pld->ref = $ref->getName();
}
return $pld;
}
示例12: save
public function save()
{
$transaction = $this->beginTransaction();
try {
$entry = new Entry();
$entry->newEntry($this->getEntry());
parent::save();
$transaction->commit();
} catch (\Exception $e) {
$transaction->rollback();
throw new \Exception($e->getMessage());
}
}
示例13: processData
public function processData($data, Entry $entry = null)
{
$driver = Extension::load('members');
if (isset($entry->data()->{$this->{'element-name'}})) {
$result = $entry->data()->{$this->{'element-name'}};
} else {
$result = (object) array('value' => null);
}
if (!is_null($data)) {
$result->value = $data;
}
return $result;
}
示例14: importEntry
public static function importEntry($path)
{
$parts = explode('/', $path);
$dir = $parts[count($parts) - 2];
$id = (int) substr($dir, 0, strpos($dir, '_'));
$name = substr($dir, strpos($dir, '_') + 1);
// do the database part
$entry = new Entry($id);
$entry->name = $name;
$entry->assignHeaders();
$entry->save();
// do the file system part
$entry->cacheContent();
}
示例15: updateEntry
public function updateEntry($newEntry)
{
$transaction = $this->beginTransaction();
try {
$this->setTimeLine(Base::updateTimeLine($this->getEntry(), $newEntry));
$entry = new Entry();
$entry->updateEntry($this->getEntry(), $newEntry);
$this->setEntry($newEntry);
parent::save();
$transaction->commit();
} catch (\Exception $e) {
$transaction->rollback();
throw new \Exception($e->getMessage());
}
}