<?php

class RecentEntryListByLabelId extends SOY2Action{

    var $limit = 3;
    var $labelId;
	
	function setLimit($limit){
		$this->limit = $limit;
	}
	
	function setLabelId($labelId){
		$this->labelId = $labelId;
	}

    function execute() {
    	
    	//最新エントリーを3件取得
    	$dao = SOY2DAOFactory::create("cms.EntryDAO");
    	
    	$logic = SOY2Logic::createInstance("logic.site.Entry.EntryLogic");
    	$logic->setLimit($this->limit);
    	
    	$this->setAttribute("entries",$logic->getRecentEntriesByLabelId($this->labelId));
    	return SOY2Action::SUCCESS;
    }
}
?>