Пример #1
0
 function create($aData)
 {
     try {
         $oCriteria = new Criteria('rbac');
         $oCriteria->add(RolesPermissionsPeer::ROL_UID, $aData['ROL_UID']);
         $oCriteria->add(RolesPermissionsPeer::PER_UID, $aData['PER_UID']);
         $oDataset = RolesPermissionsPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         $aRow = $oDataset->getRow();
         if (is_array($aRow)) {
             return true;
         }
         $oRolesPermissions = new RolesPermissions();
         $oRolesPermissions->fromArray($aData, BasePeer::TYPE_FIELDNAME);
         $iResult = $oRolesPermissions->save();
         return true;
     } catch (Exception $oError) {
         throw $oError;
     }
 }
 /**
  * Method to do selects.
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      Connection $con
  * @return     array Array of selected Objects
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelect(Criteria $criteria, $con = null)
 {
     return RolesPermissionsPeer::populateObjects(RolesPermissionsPeer::doSelectRS($criteria, $con));
 }