• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Core_Model_Default类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Core_Model_Default的典型用法代码示例。如果您正苦于以下问题:PHP Core_Model_Default类的具体用法?PHP Core_Model_Default怎么用?PHP Core_Model_Default使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Core_Model_Default类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _prepareFbPost

 protected function _prepareFbPost($post_datas)
 {
     $post = new Core_Model_Default();
     $icon_url = "https://graph.facebook.com/{$post_datas['from']['id']}/picture";
     $count_comments = isset($post_datas['comments']['data']) ? count($post_datas['comments']['data']) : 0;
     if ($count_comments == 25) {
         $count_comments = ' > ' . $count_comments;
     }
     $count_likes = isset($post_datas['likes']['data']) ? count($post_datas['likes']['data']) : 0;
     if ($count_likes == 25) {
         $count_likes = ' > ' . $count_likes;
     }
     $comments = array();
     if (!empty($post_datas['comments']['data']) && is_array($post_datas['comments']['data'])) {
         foreach ($post_datas['comments']['data'] as $comment) {
             $created_at = new Zend_Date($comment['created_time'], Zend_Date::ISO_8601, new Zend_Locale('en_US'));
             $comments[] = new Core_Model_Default(array('id' => $comment['id'], 'name' => $comment['from']['name'], 'message' => $comment['message'], 'picture' => "https://graph.facebook.com/{$comment['from']['id']}/picture", 'created_at' => $created_at->toString($this->_("MM/dd/y hh:mm a"))));
         }
     }
     $created_at = new Zend_Date($post_datas['created_time'], Zend_Date::ISO_8601, new Zend_Locale('en_US'));
     $message = '';
     if (!empty($post_datas['message'])) {
         $message = $post_datas['message'];
     } else {
         if (!empty($post_datas['story'])) {
             $message = $post_datas['story'];
         }
     }
     $picture = !empty($post_datas['picture']) ? $post_datas['picture'] : '';
     $picture = !empty($post_datas['object_id']) ? "https://graph.facebook.com/{$post_datas['object_id']}/picture?width=200" : $picture;
     $datas = array('id' => $post_datas['id'], 'author' => $post_datas['from']['name'], "avatar_url" => $icon_url, 'message' => $message, 'short_message' => strlen($message) > 300 ? Core_Model_Lib_String::truncate($message, 300) : $message, 'picture' => $picture, 'details' => !empty($post_datas['name']) ? $post_datas['name'] : '', "link" => isset($post_datas['link']) ? $post_datas['link'] : '', "created_at" => $created_at->toString($this->_("MM/dd/y hh:mm a")), "comments" => $comments, "nbr_of_comments" => $count_comments, "nbr_of_likes" => $count_likes);
     $post->setData($datas);
     return $post;
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:34,代码来源:Facebook.php


示例2: getStoreCategeories

 public static function getStoreCategeories()
 {
     $categories = array();
     foreach (self::$_store_categories as $key => $category) {
         $category_name = parent::_($category);
         $categories[$category_name] = new Core_Model_Default(array('id' => $key, 'name' => parent::_($category_name)));
     }
     ksort($categories);
     return $categories;
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:10,代码来源:Ios.php


示例3: _initRequest

 protected function _initRequest()
 {
     Core_Model_Language::prepare();
     $frontController = $this->_front_controller;
     $this->_request = new Siberian_Controller_Request_Http();
     $this->_request->isInstalling(!Installer_Model_Installer::isInstalled());
     $this->_request->setPathInfo();
     $baseUrl = $this->_request->getScheme() . '://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl();
     $this->_request->setBaseUrl($baseUrl);
     $frontController->setRequest($this->_request);
     Siberian_View::setRequest($this->_request);
     Core_Model_Default::setBaseUrl($this->_request->getBaseUrl());
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:13,代码来源:Bootstrap.php


示例4: save

 public function save()
 {
     if (!$this->getId()) {
         $this->setIsRead(0);
     }
     return parent::save();
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:7,代码来源:Notification.php


示例5: save

 public function save()
 {
     if (!$this->getPeriodId()) {
         $this->setPeriodId(self::PERIOD_WEEKLY);
     }
     return parent::save();
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:7,代码来源:Game.php


示例6: __construct

 public function __construct($params = array())
 {
     parent::__construct($params);
     $config = array('appId' => self::getAppId(), 'secret' => self::getSecretKey());
     $this->_facebook = new Facebook($config);
     return $this;
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:7,代码来源:Facebook.php


示例7: save

 public function save()
 {
     if ($this->getIsIllimited()) {
         $this->setEndDate(null);
     }
     parent::save();
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:7,代码来源:Promotion.php


示例8: save

 public function save()
 {
     parent::save();
     if ($this->getAppId() and is_array($this->_value_ids)) {
         $this->saveValueIds($this->getAppId());
     }
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:7,代码来源:Padlock.php


示例9: save

 public function save()
 {
     parent::save();
     $blocks = $this->getData('block') ? $this->getData('block') : array();
     //        if($this->getData('block')) {
     $this->getTable()->saveBlock($this->getId(), $blocks);
     //        }
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:8,代码来源:Page.php


示例10: find

 public function find($id, $field = null)
 {
     parent::find($id, $field);
     if (!$this->getId()) {
         $this->setRadius(10.0);
     }
     return $this;
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:8,代码来源:Radius.php


示例11: delete

 public function delete()
 {
     if (!$this->getId()) {
         return $this;
     }
     $this->getRootCategory()->delete();
     return parent::delete();
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:8,代码来源:Folder.php


示例12: save

 public function save()
 {
     parent::save();
     if ($resources = $this->getResources()) {
         $this->getTable()->saveResources($this->getId(), $resources);
     }
     return $this;
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:8,代码来源:Role.php


示例13: save

 public function save()
 {
     parent::save();
     if ($this->_language_data) {
         $this->getTable()->saveLanguageData($this->getId(), $this->_language_data);
     }
     return $this;
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:8,代码来源:Preview.php


示例14: prepareFeature

 public function prepareFeature($option_value)
 {
     parent::prepareFeature($option_value);
     if (!$this->getId()) {
         $this->setValueId($option_value->getValueId())->setAppId($option_value->getAppId())->save();
     }
     return $this;
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:8,代码来源:Topic.php


示例15: save

 public function save()
 {
     if ($this->getAppId()) {
         $this->getTable()->saveAppBlock($this);
     } else {
         parent::save();
     }
     return $this;
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:9,代码来源:Block.php


示例16: save

 public function save()
 {
     $price = trim(str_replace(array(Core_Model_Language::getCurrencySymbol(), ' '), '', $this->getData('price')));
     $filter = new Zend_Filter_LocalizedToNormalized();
     $filter->setOptions(array('locale' => Zend_Registry::get('Zend_Locale')));
     $this->setData('price', $filter->filter($price));
     parent::save();
     return $this;
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:9,代码来源:Option.php


示例17: save

 public function save($comment_id, $customer_id, $ip, $ua)
 {
     $duplicate_like = $this->getTable()->findByIp($comment_id, $customer_id, $ip, $ua);
     if (count($duplicate_like) == 0) {
         parent::save();
         return true;
     } else {
         return false;
     }
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:10,代码来源:Like.php


示例18: save

 public function save()
 {
     parent::save();
     if (!$this->getIsDeleted() and $this->getTypeId() == 'picasa' || $this->getTypeId() == 'instagram') {
         if ($this->getTypeInstance()->getId()) {
             $this->getTypeInstance()->delete();
         }
         $this->getTypeInstance()->setData($this->_getTypeInstanceData())->setGalleryId($this->getId())->save();
     }
     return $this;
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:11,代码来源:Image.php


示例19: save

 public function save()
 {
     $isDeleted = $this->getIsDeleted();
     parent::save();
     if (!$isDeleted) {
         if ($this->getTypeInstance()->getId()) {
             $this->getTypeInstance()->delete();
         }
         $this->getTypeInstance()->setData($this->_getTypeInstanceData())->setGalleryId($this->getId())->save();
     }
     return $this;
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:12,代码来源:Video.php


示例20: save

 public function save()
 {
     if (!$this->getSkipIsVisibleState()) {
         //            $config = new Comment_Model_Pos_Config();
         //            $config->findByPosId($this->getPosId());
         //            $this->setIsVisible((int) $config->isAutocommit());
         //            Zend_Debug::dump($config->getData());
         //            Zend_Debug::dump($this->getData());
         //            die;
     }
     $this->setIsVisible(1);
     return parent::save();
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:13,代码来源:Answer.php



注:本文中的Core_Model_Default类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Core_Model_Item_Abstract类代码示例发布时间:2022-05-23
下一篇:
PHP Core_Configuration类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap