setOriginal() 공개 메소드

Sets the original value of the attribute before modification.
public setOriginal ( null $original = null )
$original null
예제 #1
0
 /**
  * Sets and returns the models modifications.
  *
  * @return array
  */
 public function getModifications()
 {
     $dirty = $this->getDirty();
     foreach ($dirty as $attribute => $values) {
         if (!is_array($values)) {
             // Make sure values is always an array.
             $values = [$values];
         }
         $modification = new BatchModification();
         if (array_key_exists($attribute, $this->original)) {
             $modification->setOriginal($this->original[$attribute]);
         }
         $modification->setAttribute($attribute);
         $modification->setValues($values);
         $modification->build();
         $this->addModification($modification);
     }
     return $this->modifications;
 }
예제 #2
0
파일: Model.php 프로젝트: adldap2/adldap2
 /**
  * Sets and returns the models modifications.
  *
  * @return array
  */
 public function getModifications()
 {
     foreach ($this->getDirty() as $attribute => $values) {
         // Make sure values is always an array.
         $values = is_array($values) ? $values : [$values];
         // Create a new modification.
         $modification = new BatchModification($attribute, null, $values);
         if (array_key_exists($attribute, $this->original)) {
             // If the attribute we're modifying has an original value, we'll give the
             // BatchModification object its values to automatically determine
             // which type of LDAP operation we need to perform.
             $modification->setOriginal($this->original[$attribute]);
         }
         // Finally, we'll add the modification to the model.
         $this->addModification($modification->build());
     }
     return $this->modifications;
 }