getPrimaryKey() public method

This a proxy method to {@link Doctrine_Record::identifier()} for compatibility with a Propel-style API.
public getPrimaryKey ( ) : mixed
return mixed The value of the current model's last identifier column
Example #1
0
 private function executeRule(Rulerz $rule, sfDoctrineRecord $entity, $eventName)
 {
     $execution = new RulerzExecution();
     $execution->setRulerz($rule);
     $execution->setEvent($eventName);
     $execution->setEntityUid($entity->getPrimaryKey());
     try {
         ob_start();
         $lua = new Lua();
         $lua->assign('entity', $entity->toArray());
         $this->registerLuaApi($lua);
         $result = $lua->eval($rule->getAction());
         $print = ob_get_contents();
         ob_end_clean();
         $execution->setStatus('SUCCESS');
         $execution->setExecutionData(sprintf("%s\n\nResult : %s", $print, $result));
     } catch (Exception $e) {
         $execution->setStatus('FAILED');
         $execution->setExecutionData($e->__toString());
     }
     $execution->save();
 }