Pimcore\Model\Element\Sanitycheck::save PHP Method

save() public method

saves sanity check to db
public save ( ) : void
return void
    public function save()
    {
        $this->getDao()->save();
    }

Usage Example

Example #1
0
 /**
  * Clear all relations in the database
  * @param Element\ElementInterface $element
  */
 public function cleanAllForElement($element)
 {
     try {
         $id = $element->getId();
         $type = Element\Service::getElementType($element);
         //schedule for sanity check
         $data = $this->db->fetchAll("SELECT * FROM dependencies WHERE targetid = ? AND targettype = ?", array($id, $type));
         if (is_array($data)) {
             foreach ($data as $row) {
                 $sanityCheck = new Element\Sanitycheck();
                 $sanityCheck->setId($row['sourceid']);
                 $sanityCheck->setType($row['sourcetype']);
                 $sanityCheck->save();
             }
         }
         $this->db->delete("dependencies", $this->db->quoteInto("sourceid = ?", $id) . " AND " . $this->db->quoteInto("sourcetype = ?", $type));
         $this->db->delete("dependencies", $this->db->quoteInto("targetid = ?", $id) . " AND " . $this->db->quoteInto("targettype = ?", $type));
     } catch (\Exception $e) {
         \Logger::error($e);
     }
 }
All Usage Examples Of Pimcore\Model\Element\Sanitycheck::save