LeanMapper\Row::detach PHP Метод

detach() публичный Метод

Detaches Row (it means mark it as non-persisted)
public detach ( )
    public function detach()
    {
        $data = $this->result->getData($this->id);
        $this->result = Result::createDetachedInstance();
        foreach ($data as $key => $value) {
            $this->result->setDataEntry(Result::DETACHED_ROW_ID, $key, $value);
        }
        $this->id = Result::DETACHED_ROW_ID;
    }

Usage Example

Пример #1
0
 /**
  * Detaches entity
  */
 public function detach()
 {
     $this->row->detach();
     $this->entityFactory = null;
     $this->mapper = null;
 }
All Usage Examples Of LeanMapper\Row::detach