本文整理汇总了PHP中Portfolio类的典型用法代码示例。如果您正苦于以下问题:PHP Portfolio类的具体用法?PHP Portfolio怎么用?PHP Portfolio使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Portfolio类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setByData
public function setByData($data)
{
foreach ($data as $portfolioData) {
$portfolio = new Portfolio();
$portfolio->setByData($portfolioData);
$this->_portfolios[] = $portfolio;
}
}
示例2: addPortfolio
static function addPortfolio($fields)
{
extract($fields);
$portfolio = new Portfolio();
$portfolio->name = $name;
$portfolio->owner = $owner;
$portfolio->created = common_sql_now();
$portfolio->modified = common_sql_now();
$result = $portfolio->insert();
if (!$result) {
common_log_db_error($portfolio, 'INSERT', __FILE__);
return false;
}
return $portfolio;
}
示例3: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$actionBar = new \Widgets\ActionBar();
$this->getExtension()->addJS();
$actionBar->setActions(array(array("name" => \Portfolio::getInstance()->getText("newArtefacts"), "ajax" => array("onclick" => array("command" => "newArtefactForm", "namespace" => "portfolio", "params" => "", "requestType" => "popup")))));
// array("name" => "Bild anfügen<img src=\"{$editIcon}\">", "command" => "EditMessageImage", "namespace" => "forum", "params" => "{'messageObjectId':'{$this->id}','forum':'{$forumId}'}", "type" => "popup");
$breadcrumb = new \Widgets\Breadcrumb();
$breadcrumb->setData(array(array("name" => \Portfolio::getInstance()->getText("Manage Artefacts"))));
$tabBar = new \Widgets\TabBar();
$tabBar->setTabs(array(array("name" => \Portfolio::getInstance()->getText("Dashboard"), "link" => $this->getextension()->getExtensionUrl() . "/"), array("name" => \Portfolio::getInstance()->getText("Competences"), "link" => $this->getExtension()->getExtensionUrl() . "ViewChart/"), array("name" => \Portfolio::getInstance()->getText("Artefacts"), "link" => $this->getExtension()->getExtensionUrl() . "ManageArtefacts/")));
$tabBar->setActiveTab(2);
$clearer = new \Widgets\Clearer();
$loader = new \Widgets\Loader();
$loader->setWrapperId("artefactsWrapper");
$loader->setMessage("loading artefacts ...");
$loader->setCommand("loadArtefacts");
$loader->setParams($this->params);
$loader->setElementId("artefactsWrapper");
$loader->setType("updater");
$frameResponseObject->setTitle("Manage Artefacts");
$frameResponseObject->addWidget($actionBar);
$frameResponseObject->addWidget($breadcrumb);
$frameResponseObject->addWidget($tabBar);
$frameResponseObject->addWidget($clearer);
$frameResponseObject->addWidget($loader);
//$frameResponseObject->addWidget($rawHtml);
return $frameResponseObject;
}
示例4: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$actionBar = new \Widgets\ActionBar();
$actionBar->setActions(array(array("name" => \Portfolio::getInstance()->getText("new"), "ajax" => array("onclick" => array("command" => "newArtefact", "params" => array(), "requestType" => "popup")))));
$breadcrumb = new \Widgets\Breadcrumb();
$breadcrumb->setData(array(array("name" => \Portfolio::getInstance()->getText("Manage Portfolios"))));
$tabBar = new \Widgets\TabBar();
$tabBar->setTabs(array(array("name" => \Portfolio::getInstance()->getText("Dashboard"), "link" => $this->getextension()->getExtensionUrl() . "/"), array("name" => \Portfolio::getInstance()->getText("Portfolio"), "link" => $this->getExtension()->getExtensionUrl() . "MyPortfolio/"), array("name" => \Portfolio::getInstance()->getText("Shared Portfolios"), "link" => $this->getExtension()->getExtensionUrl() . "SharedProfiles/")));
$tabBar->setActiveTab(1);
$clearer = new \Widgets\Clearer();
$loader = new \Widgets\Loader();
$loader->setWrapperId("portfoliosWrapper");
$loader->setMessage("loading portfolios ...");
$loader->setCommand("loadPortfolios");
$loader->setParams(array());
$loader->setElementId("portfoliosWrapper");
$loader->setType("updater");
$frameResponseObject->setTitle("Manage Portfolios");
$frameResponseObject->addWidget($actionBar);
$frameResponseObject->addWidget($breadcrumb);
$frameResponseObject->addWidget($tabBar);
$frameResponseObject->addWidget($clearer);
$frameResponseObject->addWidget($loader);
//$frameResponseObject->addWidget($rawHtml);
return $frameResponseObject;
}
示例5: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$portfolio = \PortfolioModel::getById($this->portfolioId);
$actionBar = new \Widgets\ActionBar();
$actionBar->setActions(array(array("link" => "javascript:history.back()", "name" => "zurück"), array("name" => \Portfolio::getInstance()->getText("new"), "ajax" => array("onclick" => array("command" => "newArtefact", "params" => array(), "requestType" => "popup")))));
$breadcrumb = new \Widgets\Breadcrumb();
$breadcrumb->setData(array(array("name" => \Portfolio::getInstance()->getText("Belege des Portfolios »" . $portfolio->getName() . "«"))));
$tabBar = new \Widgets\TabBar();
$tabBar->setTabs(array(array("name" => \Portfolio::getInstance()->getText("Dashboard"), "link" => $this->getextension()->getExtensionUrl() . "/"), array("name" => \Portfolio::getInstance()->getText("Portfolio"), "link" => $this->getExtension()->getExtensionUrl() . "MyPortfolio/"), array("name" => \Portfolio::getInstance()->getText("Shared Portfolios"), "link" => $this->getExtension()->getExtensionUrl() . "SharedProfiles/")));
$tabBar->setActiveTab(1);
$clearer = new \Widgets\Clearer();
$loader = new \Widgets\Loader();
$loader->setWrapperId("artefactsWrapper");
$loader->setMessage("loading artefacts ...");
$loader->setCommand("loadArtefacts");
$loader->setParams(array(0 => $this->portfolioId));
$loader->setElementId("artefactsWrapper");
$loader->setType("updater");
$frameResponseObject->setTitle("Belege verwalten");
$frameResponseObject->addWidget($actionBar);
$frameResponseObject->addWidget($breadcrumb);
$frameResponseObject->addWidget($tabBar);
$frameResponseObject->addWidget($clearer);
$frameResponseObject->addWidget($loader);
//$frameResponseObject->addWidget($rawHtml);
return $frameResponseObject;
}
示例6: testDeleteHabtmReferenceWithConditions
/**
* testDeleteHabtmReferenceWithConditions method
*
* @return void
*/
public function testDeleteHabtmReferenceWithConditions()
{
$this->loadFixtures('Portfolio', 'Item', 'ItemsPortfolio', 'Syfile', 'Image');
$Portfolio = new Portfolio();
$Portfolio->hasAndBelongsToMany['Item']['conditions'] = array('ItemsPortfolio.item_id >' => 1);
$result = $Portfolio->find('first', array('conditions' => array('Portfolio.id' => 1)));
$expected = array(array('id' => 3, 'syfile_id' => 3, 'published' => false, 'name' => 'Item 3', 'ItemsPortfolio' => array('id' => 3, 'item_id' => 3, 'portfolio_id' => 1)), array('id' => 4, 'syfile_id' => 4, 'published' => false, 'name' => 'Item 4', 'ItemsPortfolio' => array('id' => 4, 'item_id' => 4, 'portfolio_id' => 1)), array('id' => 5, 'syfile_id' => 5, 'published' => false, 'name' => 'Item 5', 'ItemsPortfolio' => array('id' => 5, 'item_id' => 5, 'portfolio_id' => 1)));
$this->assertEquals($expected, $result['Item']);
$result = $Portfolio->ItemsPortfolio->find('all', array('conditions' => array('ItemsPortfolio.portfolio_id' => 1)));
$expected = array(array('ItemsPortfolio' => array('id' => 1, 'item_id' => 1, 'portfolio_id' => 1)), array('ItemsPortfolio' => array('id' => 3, 'item_id' => 3, 'portfolio_id' => 1)), array('ItemsPortfolio' => array('id' => 4, 'item_id' => 4, 'portfolio_id' => 1)), array('ItemsPortfolio' => array('id' => 5, 'item_id' => 5, 'portfolio_id' => 1)));
$this->assertEquals($expected, $result);
$Portfolio->delete(1);
$result = $Portfolio->find('first', array('conditions' => array('Portfolio.id' => 1)));
$this->assertFalse($result);
$result = $Portfolio->ItemsPortfolio->find('all', array('conditions' => array('ItemsPortfolio.portfolio_id' => 1)));
$this->assertEquals(array(), $result);
}
示例7: loadModel
public function loadModel($id)
{
$model = Portfolio::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例8: removePortfolio
public function removePortfolio($id)
{
$pf = Portfolio::getPfById($id);
if ($pf && $pf->verifyOwner($this->userID)) {
return $pf->removePf();
}
return false;
}
示例9: mobileValue
function mobileValue($a, $b)
{
if (Portfolio::isMobile()) {
echo $a;
} else {
echo $b;
}
}
示例10: remove_portfolio
public function remove_portfolio($portfolioId = NULL)
{
if (!$this->securitypolicy->validateAccessRight(3, 'remove')) {
$this->load->view('access_denied');
}
if ($this->input->post('portfolio-id')) {
$portfolioId = $this->input->post('portfolio-id');
}
if (isset($portfolioId)) {
$portfolio = new Portfolio();
$portfolio->remove($portfolioId);
$this->session->set_userdata(array('status' => 'success'));
redirect(site_url('Admin/view_hotel_portfolio_list'));
} else {
show_error('Portfolio ID is missing');
}
}
示例11: prepare
function prepare($args)
{
parent::prepare($args);
$this->nickname = common_canonical_nickname($this->arg('nickname'));
$this->user = User::staticGet('nickname', $this->nickname);
$this->portfolio = Portfolio::staticGet('id', $this->arg('id'));
return true;
}
示例12: getByName
/**
* Set getter by name
*
* @param string $name The set filename
* @return Smak\Portfolio\Set | null
*/
public function getByName($name)
{
parent::getByName($name);
foreach ($this->getIterator() as $file_info) {
if ($name == $file_info->getFilename()) {
return new Set($file_info);
}
}
}
示例13: actionAddToGallery
public function actionAddToGallery($modelPk, $imageName)
{
$img = new ImageGallery('create');
$img->image_name = $imageName;
$img->{Portfolio::getIdAttr()} = $modelPk;
$img->makeThumb();
$img->save();
echo CJSON::encode(array('pk'=>$img->pk));
}
示例14: relations
public function relations()
{
return CMap::mergeArray(parent::relations(), array(
'portfolioWorks' => array(self::MANY_MANY, 'PortfolioWork', 'portfolio_works_relations(portfolio_id, portfolio_work_id)'),
'gallery' => array(self::HAS_MANY, 'PortfolioGallery', Portfolio::getIdAttr(),
'order'=>'gallery.sort ASC'
),
'city' => array(self::BELONGS_TO, 'City', City::getIdAttr()),
'workType' => array(self::BELONGS_TO, 'PortfolioWorkType', PortfolioWorkType::getIdAttr()),
));
}
示例15: envPortfolio
protected function envPortfolio()
{
$portfolio = new Portfolio();
$portfolio->picture = 'img/uploaded/2.jpg';
$portfolio->title = 'My Project';
$portfolio->description = 'This is my cute dog.';
$portfolio->template_id = 1;
$portfolio->save();
$portfolio = new Portfolio();
$portfolio->picture = 'img/uploaded/park.jpeg';
$portfolio->title = 'My Project';
$portfolio->description = 'This is my favorite park';
$portfolio->template_id = 1;
$portfolio->save();
$portfolio2 = new Portfolio();
$portfolio2->picture = 'img/uploaded/2.jpg';
$portfolio2->title = 'My dog';
$portfolio2->description = 'He is a cutie';
$portfolio2->template_id = 2;
$portfolio2->save();
$portfolio21 = new Portfolio();
$portfolio21->picture = 'img/uploaded/park.jpeg';
$portfolio21->title = 'Best Park';
$portfolio21->description = 'This is my favorite park';
$portfolio21->template_id = 2;
$portfolio21->save();
$portfolio3 = new Portfolio();
$portfolio3->picture = 'img/uploaded/2.jpg';
$portfolio3->title = 'My Project';
$portfolio3->description = 'Its pretty awesome';
$portfolio3->template_id = 3;
$portfolio3->save();
$portfolio31 = new Portfolio();
$portfolio31->picture = 'img/uploaded/park.jpeg';
$portfolio31->title = 'My Project';
$portfolio31->description = 'This is my favorite park';
$portfolio31->template_id = 3;
$portfolio31->save();
}