当前位置: 首页>>代码示例>>PHP>>正文


PHP Property::setData方法代码示例

本文整理汇总了PHP中Property::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Property::setData方法的具体用法?PHP Property::setData怎么用?PHP Property::setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Property的用法示例。


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

示例1: getProperties

 public static function getProperties($type = 'newest', $order = 'default', $count = 10)
 {
     $args = array('post_type' => 'properties', 'post_status' => 'publish', 'posts_per_page' => $count);
     if ($order == 'default') {
         $args['orderby'] = 'post_date';
         $args['order'] = 'DESC';
     } else {
         if ($order == 'random') {
             $args['orderby'] = 'rand';
         }
     }
     // Prevent multiple instances of the same post if WPML is installed
     $args['suppress_filters'] = false;
     $meta_query = array();
     if ($type == 'featured') {
         $meta_query[] = array('key' => USE_PREFIX . 'featured', 'value' => 'on');
     }
     $args['meta_query'] = $meta_query;
     $key = md5(serialize($args));
     $_properties = wp_cache_get($key, THEME_NAME);
     if (!$_properties) {
         $properties = get_posts($args);
         $_properties = array();
         foreach ($properties as $property) {
             $p = new Property();
             $p->setData($property);
             $_properties[] = $p;
         }
         wp_cache_set($key, $_properties, THEME_NAME);
     }
     self::$last_query_found_items_count = count($_properties);
     return $_properties;
 }
开发者ID:pistonsky,项目名称:taivilla,代码行数:33,代码来源:propertiesmanager.class.php

示例2: setProperty

 /**
  * set a property
  *
  * @param string $name
  * @param string $type
  * @param mixed $data
  * @param boolean $inherited
  */
 public function setProperty($name, $type, $data, $inherited = false)
 {
     $this->getProperties();
     $property = new Property();
     $property->setType($type);
     $property->setCid($this->getId());
     $property->setName($name);
     $property->setCtype("asset");
     $property->setData($data);
     $property->setInherited($inherited);
     $this->properties[$name] = $property;
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:20,代码来源:Asset.php

示例3: Property

<?php

global $agent_mail_sent_success;
$schemaorg_enabled = estetico_get_setting('schemaorg_enabled');
$property = new Property();
$property->setData($post);
$meta = $property->getMeta();
$property->increaseViewCount();
ob_start();
the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', THEME_NAME));
$content = ob_get_contents();
ob_end_clean();
$gallery_content = "";
$gallery_content_regex = '/<extract>(.*?)<\\/extract>/s';
preg_match($gallery_content_regex, $content, $matches);
if (isset($matches[1])) {
    $gallery_content = $matches[1];
    $content = preg_replace($gallery_content_regex, '', $content, 1);
}
$show_map = false;
$lat = $property->getLatitude();
$lng = $property->getLongitude();
if (!empty($lat) && !empty($lng)) {
    $show_map = true;
}
$properties_page_url = estetico_get_properties_page_url();
?>

<article id="post-<?php 
the_ID();
?>
开发者ID:pistonsky,项目名称:taivilla,代码行数:31,代码来源:content-properties.php


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