Get unposted Postings

@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since  0.8.0

@return ArrayCollection|Posting
765527
public function getUnpostedPostings()
    {
        $criteria = Criteria::create()
            ->where(Criteria::expr()->eq('postedAt', null))
        ;

        return $this->getPostings()->matching($criteria);
    }
973222
public function filterPosters()
    {
        return $this->filter(
            function ($key, $value) {
                if ($value instanceof ImageFilter && $value instanceof Image\PosterImage) {
                    return true;
                }
            }
        );
    }
141326
public function getPostParams()
    {
        if (is_array($this->postParams)) {
            return $this->postParams;
        }
        
        //$posts = $this->getParsedBody();  // 可能是 xml 对象
        if (($input = static::getPostInputInfo())) {
            $this->postParams = $input[1];
        } else {
            $this->postParams = $_POST;
        }
        
        return $this->postParams;
    }
397008
public function setPosts(ArrayCollection $posts)
    {
        /** @var \Icap\BlogBundle\Entity\Post[] $posts */
        foreach ($posts as $post) {
            $post->setBlog($this);
        }

        $this->posts = $posts;

        return $this;
    }
35674
public function get_array() {
	$response = array();
	
	// links
	if ($this->links) {
		$response['links'] = $this->links;
	}
	
	// primary data
	$response['data'] = $this->primary_collection;
	
	// included resources
	if ($this->included_data) {
		$response['included'] = array_values($this->included_data);
	}
	
	// meta data
	if ($this->meta_data) {
		$response['meta'] = $this->meta_data;
	}
	
	return $response;
}
793918
public function searchPosts()
    {
        $query = Vocabulary::find()->select('post_id, thread_id')->joinWith(['posts.author', 'posts.thread'])->andWhere(['is not', 'post_id', null]);
        if (Podium::getInstance()->user->isGuest) {
            $query->joinWith(['posts.forum' => function ($q) {
                $q->andWhere([Forum::tableName() . '.visible' => 1])->joinWith(['category' => function ($q) {
                    $q->andWhere([Category::tableName() . '.visible' => 1]);
                }]);
            }]);
        }
        if (!empty($this->query)) {
            $words = explode(' ', preg_replace('/\s+/', ' ', $this->query));
            $countWords = 0;
            foreach ($words as $word) {
                $query->orWhere(['like', 'word', $word]);
                $countWords++;
            }
            $query->groupBy('post_id');
            if ($this->match == 'all' && $countWords > 1) {
                $query->select(['post_id', 'thread_id', 'COUNT(post_id) AS c'])->having(['>', 'c', $countWords - 1]);
            }
        }
        $this->prepareQuery($query);
        $sort = [
            'defaultOrder' => ['post_id' => SORT_DESC],
            'attributes' => [
                'post_id' => [
                    'asc' => ['post_id' => SORT_ASC],
                    'desc' => ['post_id' => SORT_DESC],
                    'default' => SORT_DESC,
                ],
            ]
        ];
        return new ActiveDataProvider([
            'query' => $query,
            'sort' => $sort,
        ]);
    }
1075465
public function getOriginalCollection()
    {
        $bID = $this->getBlockID();
        if ($bID) {
            $db = Loader::db();
            $q = 'select Pages.cID, cIsTemplate from Pages inner join CollectionVersionBlocks on (CollectionVersionBlocks.cID = Pages.cID) where CollectionVersionBlocks.bID = ? and CollectionVersionBlocks.isOriginal = 1';
            $r = $db->query($q, [$bID]);
            if ($r) {
                $row = $r->fetchRow();
                $cID = $row['cID'];
                $nc = Page::getByID($cID, 'ACTIVE');
                if (is_object($nc) && !$nc->isError()) {
                    return $nc;
                }
            }
        }
    }
1267298
function ctc_get_posts() {

		// Get posts
		$posts = get_posts( array(
			'post_type'      	=> 'ctc_location',
			'orderby'        	=> $this->ctc_instance['orderby'],
			'order'          	=> $this->ctc_instance['order'],
			'numberposts'    	=> $this->ctc_instance['limit'],
			'suppress_filters'	=> false // keep WPML from showing posts from all languages: http://bit.ly/I1JIlV + http://bit.ly/1f9GZ7D
		) );

		// Return filtered
		return apply_filters( 'ctc_locations_widget_get_posts', $posts );

	}
832710
public function Replies()
    {
        // No replies if disabled
        if (!$this->getRepliesEnabled()) {
            return new ArrayList();
        }
        $list = $this->AllReplies();

        // Filter spam comments for non-administrators if configured
        $parent = $this->Parent();
        $showSpam = $this->getOption('frontend_spam') && $parent && $parent->canModerateComments();
        if (!$showSpam) {
            $list = $list->filter('IsSpam', 0);
        }

        // Filter un-moderated comments for non-administrators if moderation is enabled
        $showUnmoderated = $parent && (
            ($parent->ModerationRequired === 'None')
            || ($this->getOption('frontend_moderation') && $parent->canModerateComments())
        );
        if (!$showUnmoderated) {
            $list = $list->filter('Moderated', 1);
        }

        $this->extend('updateReplies', $list);
        return $list;
    }
1333355
public function getPublishedPosts()
    {
        return PostSearch::find()
            ->joinWith('category')
            ->where(['publish_status' => Post::STATUS_PUBLISHED, 'blog_category.id' => $this->id])
            ->all();
    }
1245887
public function getResult()
    {
        $result = $this->execute();
        $list = new ArrayCollection;

        //Loop through results
        foreach ($result as $row)
        {
            $entry = array();

            //Loop through entities attributes (or relations)
            foreach ($row as $key => $value)
            {
                $entry[$key] = $this->convertValue($value);
            }

            //Add to list
            $list->add($entry);
        }

        return $list;
    }
392775
public function getGranted()
    {
        $databoxes = [];

        /** @var \collection $collection */
        foreach ($this->acl->get_granted_base([\ACL::CANREPORT]) as $collection) {
            $sbas_id = $collection->get_sbas_id();
            if (!isset($databoxes[$sbas_id])) {
                $databoxes[$sbas_id] = [
                    'id' => $sbas_id,
                    'name' => $collection->get_databox()->get_viewname(),
                    'collections' => []
                ];
            }
            $databoxes[$sbas_id]['collections'][$collection->get_base_id()] = [
                'id' => $collection->get_base_id(),
                'coll_id' => $collection->get_coll_id(),
                'name' => $collection->get_name()
            ];
        }

        return ['databoxes' => $databoxes];
    }
55560
public static function get_posts( $args ) {
		if ( is_string( $args ) ) {
			$args = add_query_arg(
				[
					'suppress_filters' => false,
				]
			);
		} elseif ( is_array( $args ) && ! isset( $args['suppress_filters'] ) ) {
			$args['suppress_filters'] = false;
		}

		// Get the posts.
		// TODO: WordPress.VIP.RestrictedFunctions.get_posts_get_posts.
		$posts = get_posts( $args );

		// Properly format the array.
		$items = [];
		foreach ( $posts as $post ) {
			$items[ $post->ID ] = $post->post_title;
		}
		wp_reset_postdata();

		return $items;
	}
879897
public function toArray()
    {
        $data = array();
        foreach ($this->violations as $violation) {
            $data[] = $violation->getMessage();
        }

        return $data;
    }
726838
public function PaginatedList()
    {
        $all_posts = $this->blogPosts ?: ArrayList::create();

        $posts = PaginatedList::create($all_posts);

        $posts->setPageLength($this->PostsPerPage);

        // Set current page
        $start = $this->request->getVar($posts->getPaginationGetVar());
        $posts->setPageStart($start);

        return $posts;
    }
1076397
protected function getUnrenderedFields()
    {
        $unrenderedFields = [];

        foreach ($this->fields as $field) {
            if (!$field->isRendered()) {
                $unrenderedFields[] = $field;
                continue;
            }
        }

        return $unrenderedFields;
    }
703410
public function getParams()
    {
        if ($this->_params !== null) {
            return $this->_params;
        } else {
            $this->_params = new Collection([]);
            return $this->_params;
        }
    }