Sync handler
@param  object $obj
@return void
542838
private function sync($obj) {

		$sync = (!empty(config('firebase')))
				 ? config('firebase.sync')
				 : config('database.connections.firebase.sync');	// `sync` by Default (config)?
		$path = strtolower(get_class($obj)).'s';					// plural collection name
		$id   = \Firebase::getId($obj);								// object ID (extracted)

		// Whitelist
		if (isset($obj->firebase) && !empty($obj->firebase) && is_array($obj->firebase)) {
			$data = [];
			foreach ($obj->toArray() as $key => $value) {
				// Filter Attributes
				if (in_array($key, $obj->firebase) !== false) $data[$key] = $value;
			}
		} else {
			$data = $obj->toArray();
		}

		// Post if Allowed
		if ((($sync !== false || !empty($obj->firebase)) && $obj->firebase !== false) || $obj->firebase === true) {
			\Firebase::set('/'.$path.'/'.$id, $data);
		}

		return true;
	}
820382
public function syncRaw()
    {
        if ($model = $this->fresh()) {
            $this->setRawAttributes($model->getAttributes());

            return true;
        }

        return false;
    }
594849
public function Equals($obj)
	{
		if ( ! $obj instanceof TokenValue )
		{
			return false;
		}

		/**
		 * @var TokenValue $other
		 */
		$other = $obj;
		return strcmp( $this->Value, $other->Value ) == 0;
	}
139488
public function update($object)
    {
        try {
            $this->dm->persist($object);
            $this->dm->flush();
        } catch (\Exception $e) {
            throw new ModelManagerException('', 0, $e);
        }
    }
1219428
public function destroy($obj): void
    {
        // del metadata
        $id = $this->genID($obj);

        if (isset($this->metas[$id])) {
            unset($this->metas[$id]);
        }

        $obj = null;
    }
129555
public function DeleteAll($obj)
	{
		$fms = $this->GetFieldMaps(get_class($obj));
		$pk = $obj->GetPrimaryKeyName();
		$table = $fms[$pk]->TableName;

		$sql = "delete from `$table`";
		$returnval = $this->DataAdapter->Execute($sql);
		$obj->OnDelete(); // fire OnDelete event
		return $returnval;

	}
1142122
public function syncronizeLocationsFromContentObject(ContentObject $object)
    {
        /** @var LocationObject[] $parentLocations */
        $parentLocations = $object->getProperty('parent_locations');
        if (is_array($parentLocations) && count($parentLocations) > 0) {
            $addOrUpdate = [];
            foreach ($parentLocations as $parentLocation) {
                $addOrUpdate[$parentLocation->data['parent_location_id']] = $parentLocation;
            }

            // Filter which Locations should be created/updated and deleted.
            $delible = $this->filterLocationsToBeDeleted($object, $addOrUpdate);

            // Create or update locations, and attach to Content
            foreach ($addOrUpdate as $parentLocation) {
                $parentLocation->data['content_id'] = $object->getProperty('content_info')->id;
                $locationObject = $this->createOrUpdate($parentLocation);
                $object->addParentLocation($locationObject);
            }

            // Lastly delete. We cannot delete first because Content cannot remove it's last Location.
            foreach ($delible as $delete) {
                $this->locationService->deleteLocation($delete);
            }
        }
    }
1060998
public function Equals( $obj )
	{
		if ( ! $obj instanceof GMonthValue )
		{
			return false;
		}

		/**
		 * @var DateTimeValueBase $other
		 */
		$other = $obj;
		return $this->ToString( null ) == $other->ToString( null );
	}
919952
public function delete($obj)
    {
        $o      = $this->convertToDB($obj);
        $pk     = $this->getPK();
        $sql    = 'DELETE FROM ' . $this->table() . ' WHERE ' . $pk->identifier() . ' = ?';
        $params = [$o->{$pk->identifier()}];

        GapOrm::getDriver()->query($sql, $params);
        $query = GapOrm::getDriver()->delete();

        if ($query) {
            return true;
        }

        return false;
    }
1010320
def sync(obj, engine):
    """"""
    snapshot = Condition()
    # Only expect values (or lack of a value) for columns that have been explicitly set
    for column in sorted(_obj_tracking[obj]["marked"], key=lambda col: col.dynamo_name):
        value = getattr(obj, column.name, None)
        value = engine._dump(column.typedef, value)
        condition = column == value
        # The renderer shouldn't try to dump the value again.
        # We're dumping immediately in case the value is mutable,
        # such as a set or (many) custom data types.
        condition.dumped = True
        snapshot &= condition
    _obj_tracking[obj]["snapshot"] = snapshot
689069
public function push($obj, $s = false)
    {
        if (_CLI_) {
            $id = $this->key . '_' . get_co_id();
            if (isset(self::$sw[$id])) {
                if ($s || $obj !== self::$sw[$id]) {
                    unset(self::$sw[$id]);
                    static::$pools[$this->key]->push($obj);
                }
            } else {
                static::$pools[$this->key]->push($obj);
            }
        }
    }
1075920
protected void handleUpdatedObject(final Object object) {
		runWithWriteLock(new Runnable() {
			public void run() {
				int index = getFinalEventList().indexOf(object);
				if (index >= 0) {
					getFinalEventList().set(index, object);
				}
			}
		});
	}
15303
private function delete($obj) {

		$sync = (!empty(config('firebase')))
				 ? config('firebase.sync')
				 : config('database.connections.firebase.sync');	// `sync` by Default (config)?
		$path = strtolower(get_class($obj)).'s';					// plural collection name
		$id   = \Firebase::getId($obj);								// object ID (extracted)

		// Delete if Allowed
		if ($sync !== false || !empty($obj->firebase)) {
			\Firebase::delete('/'.$path.'/'.$id);
		}
	}
92174
public function sync()
    {
        $service = Injector::inst()->get(LDAPService::class);
        if (!$service->enabled() ||
            !$this->owner->GUID
        ) {
            return;
        }
        $service->updateLDAPFromMember($this->owner);
        $service->updateLDAPGroupsForMember($this->owner);
    }
22705
public function persist($object, $flush = true)
    {
        if ($object->getId()) {
            $this->update($object, $flush);
        } else {
            $this->create($object, $flush);
        }
    }
926723
public function sync()
    {
        $this->connection()->transaction(function () {
            foreach ($this->editable() as $field) {
                // get original HTML input
                $field = $field->getInput();

                $name = $field->getName();

                if ($this->isKey($field) || $this->isTranslatable($field) || $this->isMediaFile($field)) {
                    continue;
                }

                $this->collectRelations($field, $name);

                $value = $this->isFile($field) ? $this->request->file($name) : $this->request->get($name);

                $value = $this->isBoolean($field) ? (bool) $value : $value;

                $value = $this->handleJsonType($name, $value);

                $this->data[$name] = $value;
            }

            $this->cleanData();

            $this->collectTranslatable();

            $this->appendTranslationsToRelations();

            Model::unguard();

            /*
            |-------------------------------------------------------
            | Save main data
            |-------------------------------------------------------
            */
            $this->save();

            /*
            |-------------------------------------------------------
            | Relationships
            |-------------------------------------------------------
            | Save related data, fetched by "relation" from related tables
            */
            $this->saveRelations();

            $this->saveMedia();

            Model::reguard();
        });

        return $this->repository;
    }
58835
protected function persist($object)
    {
        if(!$object->getId()) {
            $object->setId($this->getNextId());
        }
        $key = $this->getHash().$object->getId();
        $content = serialize($object);
        
        $this->getFileManager()->write($key, $content, true);
    }