ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 11258


Ignore:
Timestamp:
Apr 9, 2009, 8:09:50 PM (11 years ago)
Author:
ebihara
Message:

#3765:imported new models for Doctrine from some old models for Propel to enable to login to backend

Location:
OpenPNE3/branches/goto_doctrine
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/lib/opAdminLoginForm.class.php

    r10003 r11258  
    4646  public static function validate($validator, $values, $arguments = array())
    4747  {
    48     $adminUser = AdminUserPeer::retrieveByUsername($values['username']);
     48    $adminUser = Doctrine::getTable('AdminUser')->retrieveByUsername($values['username']);
    4949    if (!$adminUser)
    5050    {
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/modules/admin/actions/actions.class.php

    r11248 r11258  
    3535  public function executeManageUser(sfWebRequest $request)
    3636  {
    37     $this->users = AdminUserPeer::retrievesAll();
     37    $this->users = Doctrine::getTable('AdminUser')->retrievesAll();
    3838  }
    3939
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/modules/design/actions/actions.class.php

    r11219 r11258  
    6060  public function executeGadget(sfWebRequest $request)
    6161  {
    62     $this->type = $request->getParameter('type', Doctrine::getTable('Gadget')::HOME_TYPES);
     62    $this->type = $request->getParameter('type', GadgetTable::HOME_TYPES);
    6363    $this->gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName($this->type);
    6464
     
    9595    if ($layout)
    9696    {
    97       $this->layoutPattern = $layout->getValue();
     97      $this->layoutPattern = $layout;
    9898    }
    9999
     
    131131  public function executeAddGadget(sfWebRequest $request)
    132132  {
    133     $this->type = $request->getParameter('type', Doctrine::getTable('Gadget')::TOP_TYPE);
     133    $this->type = $request->getParameter('type', GadgetTable::TOP_TYPE);
    134134    $this->config = Doctrine::getTable('Gadget')->getGadgetConfigListByType($this->type);
    135135
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/modules/design/lib/PickHomeLayoutForm.class.php

    r11209 r11258  
    2626    if ($snsConfig)
    2727    {
    28       $default = array_search($snsConfig->getValue(), $this->choices);
     28      $default = array_search($snsConfig, $this->choices);
    2929    }
    3030
     
    4949    }
    5050
    51     $snsConfig = Doctrine::getTable('SnsConfig')->get($this->getOption('layout_name', 'home_layout'));
     51    $snsConfig = Doctrine::getTable('SnsConfig')->retrieveByName($this->getOption('layout_name', 'home_layout'));
    5252    if (!$snsConfig)
    5353    {
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/modules/profile/actions/actions.class.php

    r11248 r11258  
    2626  public function executeList($request)
    2727  {
    28     $this->profiles = ProfilePeer::retrievesAll();
     28    $this->profiles = Doctrine::getTable('Profile')->retrievesAll();
    2929    $this->option_form = array();
    3030
    31     $criteria = new Criteria();
    32     $criteria->addAscendingOrderByColumn(ProfileOptionPeer::SORT_ORDER);
    3331    foreach ($this->profiles as $value) {
    3432      $this->option_form[$value->getId()] = array();
    35       foreach ($value->getProfileOptions($criteria) as $option) {
     33      foreach ($value->getProfileOptions() as $option) {
    3634        $this->option_form[$value->getId()][$option->getId()] = new ProfileOptionForm(Doctrine::getTable('ProfileOption')->find($option->getId()));
    3735      }
  • OpenPNE3/branches/goto_doctrine/apps/pc_frontend/modules/member/actions/actions.class.php

    r11219 r11258  
    2525  public function executeHome($request)
    2626  {
     27    $this->topGadgets = null;
     28    $this->sideMenuGadgets = null;
     29
    2730    $this->gadgetConfig = sfConfig::get('op_gadget_list');
    2831    $layout = Doctrine::getTable('SnsConfig')->get('home_layout');
    2932    if ($layout)
    3033    {
    31       $this->setLayout($layout->getValue());
     34      $this->setLayout($layout);
    3235    }
    3336
    34     if (!$layout || $layout->getValue() === 'layoutA')
     37    if (!$layout || $layout === 'layoutA')
    3538    {
    3639      $this->topGadgets = Doctrine::getTable('Gadget')->retrieveTopGadgets();
    3740    }
    38     if (!$layout || $layout->getValue() === 'layoutA' || $layout->getValue() === 'layoutB')
     41    if (!$layout || $layout === 'layoutA' || $layout === 'layoutB')
    3942    {
    4043      $this->sideMenuGadgets = Doctrine::getTable('Gadget')->retrieveSideMenuGadgets();
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/Gadget.class.php

    r11250 r11258  
    1313  public function preSave($event)
    1414  {
    15     if (!$this->sortOrder)
     15    if (!$this->getSortOrder())
    1616    {
    1717      $maxSortOrder = 0;
    1818
    19       $gadgets = Doctrine::getTable('Gadget')->retrieveByType($this->type);
     19      $gadgets = Doctrine::getTable('Gadget')->retrieveByType($this->getType());
    2020      if ($gadgets)
    2121      {
     
    2323        if ($finalGadget)
    2424        {
    25           $maxSortOrder = $finalGadget->sortOrder;
     25          $maxSortOrder = $finalGadget->getSortOrder();
    2626        }
    2727      }
    2828
    29       $this->sortOrder = $maxSortOrder + 10;
     29      $this->setSortOrder($maxSortOrder + 10);
    3030    }
    3131  }
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/GadgetTable.class.php

    r11219 r11258  
    158158  protected function getResults()
    159159  {
    160     if (is_null($this->results))
     160    if (empty($this->results))
    161161    {
    162162      $this->results = array();
     
    167167      }
    168168    }
    169 
    170169    return $this->results;
    171170  }
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/NavigationTable.class.php

    r11219 r11258  
    4444    }
    4545
    46     $result = $this->createQuery()
     46    $resultSet = $this->createQuery()
    4747      ->select('type')
    4848      ->groupBy('type')
     
    5050      ->fetchArray();
    5151
     52    foreach ($resultSet as $item)
     53    {
     54      $result[] = $item['type'];
     55    }
     56
    5257    return array_unique(array_merge($defaultTypes, $result));
    5358  }
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/SnsConfigTable.class.php

    r11209 r11258  
    4545      $this->configs = array();
    4646
    47       foreach ($this->createQuery()->fetchArray() as $config)
     47      foreach ($this->createQuery()->execute() as $config)
    4848      {
    4949        $this->configs[$config->name] = $config;
Note: See TracChangeset for help on using the changeset viewer.