Example #1
0
 /**
  * Retrieves an associative array of primary keys.
  *
  * @param bool $useDirty
  * @return array
  */
 protected function _getPrimaryKey($useDirty = true)
 {
     $primary = array_flip($this->_table->getPrimary());
     if ($useDirty) {
         $array = array_intersect_key($this->getArrayCopy(), $primary);
     } else {
         $array = array_intersect_key($this->_cleanData + $this->getArrayCopy(), $primary);
     }
     if (count($primary) != count($array)) {
         throw new DataObjectException("The specified Table '" . get_class($this->_table) . "' does not have the same primary key as the Row");
     }
     return $array;
 }