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


PHP Companies::find方法代码示例

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


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

示例1: searchAction

 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Phalcon_Model_Query::fromInput("Companies", $_POST);
         $this->session->conditions = $query->getConditions();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
         if ($numberPage <= 0) {
             $numberPage = 1;
         }
     }
     $parameters = array();
     if ($this->session->conditions) {
         $parameters["conditions"] = $this->session->conditions;
     }
     $parameters["order"] = "id";
     $companies = Companies::find($parameters);
     if (count($companies) == 0) {
         Flash::notice("The search did not find any companies", "alert alert-info");
         return $this->_forward("companies/index");
     }
     $paginator = Phalcon_Paginator::factory("Model", array("data" => $companies, "limit" => 10, "page" => $numberPage));
     $page = $paginator->getPaginate();
     $this->view->setVar("page", $page);
     $this->view->setVar("companies", $companies);
 }
开发者ID:racklin,项目名称:invo,代码行数:27,代码来源:CompaniesController.php

示例2: searchAction

 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Companies", $_POST);
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
         if ($numberPage <= 0) {
             $numberPage = 1;
         }
     }
     $parameters = array();
     if ($this->persistent->searchParams) {
         $parameters = $this->persistent->searchParams;
     }
     $companies = Companies::find($parameters);
     if (count($companies) == 0) {
         $this->flash->notice("The search did not find any companies");
         return $this->forward("companies/index");
     }
     $paginator = new Phalcon\Paginator\Adapter\Model(array("data" => $companies, "limit" => 10, "page" => $numberPage));
     $page = $paginator->getPaginate();
     $this->view->setVar("page", $page);
     $this->view->setVar("companies", $companies);
 }
开发者ID:netstu,项目名称:invo,代码行数:26,代码来源:CompaniesController.php

示例3: searchAction

 /**
  * Searches for companies
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Companies", $_POST);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "id";
     $companies = Companies::find($parameters);
     if (count($companies) == 0) {
         $this->flash->notice("The search did not find any companies");
         return $this->dispatcher->forward(array("controller" => "companies", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $companies, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
开发者ID:nhannv56,项目名称:sample2_Phalcon_INVO,代码行数:25,代码来源:CompaniesController.php

示例4: findOwnerCompany

 /**
  * Return owner company from database
  *
  * @param void
  * @return Company
  */
 function findOwnerCompany()
 {
     return Companies::find(array('conditions' => array('is_owner = ?', true), 'one' => true));
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:10,代码来源:Companies.class.php

示例5: getDelete

 public function getDelete($id = '')
 {
     if ($id == '') {
         return Redirect::to($this->route)->with('msg_error', Lang::get('messages.companies_display_err'));
     } else {
         $company = Companies::find($id);
         $delete = Companies::destroy($id);
         if (!$delete) {
             return Redirect::to($this->route . '/trash')->with('msg_error', Lang::get('messages.companies_delete_err', array('title' => $company->title)));
         } else {
             return Redirect::to($this->route . '/trash')->with('msg_success', Lang::get('messages.companies_delete', array('title' => $company->title)));
         }
     }
 }
开发者ID:nagyist,项目名称:abge,代码行数:14,代码来源:AssociateController.php

示例6: doDelete

 /**
  * Form for POST doDelete the specified resource.
  *
  * @return Response
  */
 public function doDelete()
 {
     $aData = Input::all();
     if (isset($aData['id'])) {
         $company = Companies::find($aData['id']);
         $company->delete();
         return Redirect::route('company-list')->with('message', 'Компания успешно удален');
     }
     return Redirect::route('company-list')->with('message', 'Произошла ошибка удаления');
 }
开发者ID:sergey-donchenko,项目名称:hr-agency,代码行数:15,代码来源:CompaniesController.php

示例7:

use backend\models\companies;
/* @var $this yii\web\View */
/* @var $model backend\models\Branches */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="branches-form">

    <?php 
$form = ActiveForm::begin();
?>



    <?php 
echo $form->field($model, 'companies_company_id')->dropDownList(ArrayHelper::map(Companies::find()->all(), 'company_id', 'company_name'), ['promp' => 'Select Company']);
?>

    <?php 
echo $form->field($model, 'branch_name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'branch_address')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'branch_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => 'Status']);
?>

    <div class="form-group">
开发者ID:komsin,项目名称:yii2advanced,代码行数:31,代码来源:_form.php


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