src/mako/database/midgard/ORM.php
public function save(): bool
	{
		$success = true;

		if(!$this->isPersisted)
		{
			// This is a new record so we need to insert it into the database.

			$this->insertRecord($this->builder());

			$this->isPersisted = true;
		}
		elseif($this->isModified())
		{
			// This record exists and is modified so all we have to do is update it.

			$success = $this->updateRecord($this->builder());
		}

		if($success)
		{
			// Sync up if save was successful

			$this->synchronize();
		}

		return $success;
	}
public function save(): bool
	{
		$success = true;

		if(!$this->isPersisted)
		{
			// This is a new record so we need to insert it into the database.

			$this->insertRecord($this->builder());

			$this->isPersisted = true;
		}
		elseif($this->isModified())
		{
			// This record exists and is modified so all we have to do is update it.

			$success = $this->updateRecord($this->builder());
		}

		if($success)
		{
			// Sync up if save was successful

			$this->synchronize();
		}

		return $success;
	}
public function save ( ) : bool { $ success = true ; if ( ! $ this -> isPersisted ) { // This is a new record so we need to insert it into the database. $ this -> insertRecord ( $ this -> builder ( ) ) ; $ this -> isPersisted = true ; } elseif ( $ this -> isModified ( ) ) { // This record exists and is modified so all we have to do is update it. $ success = $ this -> updateRecord ( $ this -> builder ( ) ) ; } if ( $ success ) { // Sync up if save was successful $ this -> synchronize ( ) ; } return $ success ; }
Saves the record to the database.

@return bool
Saves the record to the database .