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


PHP Model::get方法代码示例

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


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

示例1: get

 /**
  * Get the value of the field of a loaded model. If model is not loaded
  * will return default value instead.
  *
  * @return mixed current value of a field
  */
 public function get()
 {
     if ($this->owner->loaded() || isset($this->owner->data[$this->short_name])) {
         return $this->owner->get($this->short_name);
     }
     return $this->defaultValue();
 }
开发者ID:atk4,项目名称:atk4,代码行数:13,代码来源:Base.php

示例2: __construct

 /**
  * Creates a new ModelField. The example below creates a ModelField which
  * lists client accounts for selection.
  * 
  * @code
  * $clients = new ModelField("brokerage.setup.clients.client_id", "account");
  * @endcode
  * @param $path The full path to the field in the module which is to be returned by this field.
  * @param $value The name of the field from the model whose value should be displayed in the list.
  */
 public function __construct($path, $value)
 {
     global $redirectedPackage;
     $this->info = Model::resolvePath($path);
     $this->model = Model::load((substr($this->info["model"], 0, 1) == "." ? $redirectedPackage : "") . $this->info["model"]);
     $this->valueField = $value;
     $field = $this->model->getFields(array($value));
     $this->setLabel($field[0]["label"]);
     $this->setDescription($field[0]["description"]);
     $this->setName($this->info["field"]);
     $params = array("fields" => array($this->info["field"], $this->valueField), "sort_field" => $this->valueField);
     if ($this->conditions != '') {
         $params['conditions'] = $this->conditions;
     }
     $data = $this->model->get($params, Model::MODE_ARRAY);
     $this->addOption("Add new " . Utils::singular($this->model->getEntity()), 'NEW');
     foreach ($data as $datum) {
         if ($datum[1] == "") {
             $this->addOption($datum[0]);
         } else {
             $this->addOption($datum[1], $datum[0]);
         }
     }
     $modelPath = str_replace('.', '/', $this->model->package);
     $this->addAttribute('onchange', "fapiAddModelItem('{$modelPath}', this, '{$value}')");
 }
开发者ID:ekowabaka,项目名称:wyf,代码行数:36,代码来源:ModelField.php

示例3: remover

 public static function remover(Model $imagem)
 {
     if ($imagem->get("id_imagem")) {
         $sql = "delete from imagem where id_imagem = :id_imagem";
     }
     return self::exec($sql, $imagem);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:ImagemDAO.php

示例4: remover

 public static function remover(Model $origem_cliente)
 {
     if ($origem_cliente->get("id")) {
         $sql = "delete from origem_cliente where id = :id";
     }
     return self::exec($sql, $origem_cliente);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:OrigemClienteDAO.php

示例5: removerTodosPorGaleria

 public static function removerTodosPorGaleria(Model $galeria_item)
 {
     if ($galeria_item->get('id_galeria')) {
         $sql = "delete from galeria_item where id_galeria = :id_galeria";
     }
     return self::exec($sql, $galeria_item);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:Galeria_ItemDAO.php

示例6: remover

 public static function remover(Model $produto)
 {
     if ($produto->get("id")) {
         $sql = "delete from produto where id = :id";
     }
     return self::exec($sql, $produto);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:ProdutoDAO.php

示例7: remover

 public static function remover(Model $modalidade)
 {
     if ($modalidade->get("id")) {
         $sql = "delete from modalidade where id = :id";
     }
     return self::exec($sql, $modalidade);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:ModalidadeDAO.php

示例8: remover

 public static function remover(Model $status_visita)
 {
     if ($status_visita->get("id")) {
         $sql = "delete from status_visita_orientacao where id = :id";
     }
     return self::exec($sql, $status_visita);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:StatusVisitaDAO.php

示例9: remover

 public static function remover(Model $motivo_nao_orientacao)
 {
     if ($motivo_nao_orientacao->get("id")) {
         $sql = "delete from motivo_nao_orientacao where id = :id";
     }
     return self::exec($sql, $motivo_nao_orientacao);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:MotivoNaoOrientacaoDAO.php

示例10: remover

 public static function remover(Model $centro_custo)
 {
     if ($centro_custo->get("id")) {
         $sql = "delete from centro_custo where id = :id";
     }
     return self::exec($sql, $centro_custo);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:CentroCustoDAO.php

示例11: remover

 public static function remover(Model $log)
 {
     if ($log->get("id")) {
         $sql = "delete from log where id = :id";
     }
     return self::exec($sql, $log);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:LogDAO.php

示例12: remover

 public static function remover(Model $uf)
 {
     if ($uf->get("id")) {
         $sql = "delete from uf where id = :id";
     }
     return self::exec($sql, $uf);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:UfDAO.php

示例13: consultarPorCodigo

 public static function consultarPorCodigo(Model $agencia_producao)
 {
     if ($agencia_producao->get('codigo')) {
         $sql = "select ap.id,\n                           ap.nome,\n                           ap.codigo,\n                           u.id as id_uf,\n                           u.nome as uf\n                      from agencia_producao ap\n                      inner join uf u\n                      on ap.id_uf = u.id\n                     where codigo = :codigo\n                       and ativo = :ativo";
         return self::query($sql, $agencia_producao);
     }
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:AgenciaProducaoDAO.php

示例14: remover

 public static function remover(Model $tipo_aval)
 {
     if ($tipo_aval->get("id")) {
         $sql = "delete from tipo_aval where id = :id";
     }
     return self::exec($sql, $tipo_aval);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:TipoAvalDAO.php

示例15: remover

 public static function remover(Model $video_youtube)
 {
     if ($video_youtube->get("id_youtube")) {
         $sql = "delete from youtube where id_youtube = :id_youtube";
     }
     return self::exec($sql, $video_youtube);
 }
开发者ID:cokita,项目名称:srp,代码行数:7,代码来源:Video_YoutubeDAO.php


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