Example #1
0
 /**
  * Encrypted Id after find
  * @param array $result data
  * @param bool  $primary
  * @return array $result encrypted id
  * @author Laxmi Saini
  */
 public function afterFind($results, $primary = false)
 {
     $collection = new ComponentCollection();
     $Encryption = new EncryptionComponent($collection);
     foreach ($results as $key => $val) {
         if (isset($val[$this->alias]['id'])) {
             $results[$key][$this->alias]['id'] = $Encryption->encode($val[$this->alias]['id']);
         }
     }
     return $results;
 }