src/mako/database/midgard/ORM.php
public function assign(array $columns, bool $raw = false, bool $whitelist = true)
	{
		// Remove columns that are not in the whitelist

		if($whitelist && !empty($this->assignable))
		{
			$columns = array_intersect_key($columns, array_flip($this->assignable));
		}

		// Remove the primary key if the model has already beed loaded

		if($this->isPersisted && isset($columns[$this->primaryKey]))
		{
			unset($columns[$this->primaryKey]);
		}

		// Set column values

		$this->setColumValues($columns, $raw);

		return $this;
	}
public function assign(array $columns, bool $raw = false, bool $whitelist = true)
	{
		// Remove columns that are not in the whitelist

		if($whitelist && !empty($this->assignable))
		{
			$columns = array_intersect_key($columns, array_flip($this->assignable));
		}

		// Remove the primary key if the model has already beed loaded

		if($this->isPersisted && isset($columns[$this->primaryKey]))
		{
			unset($columns[$this->primaryKey]);
		}

		// Set column values

		$this->setColumValues($columns, $raw);

		return $this;
	}
public function assign ( array $ columns , bool $ raw = false , bool $ whitelist = true ) { // Remove columns that are not in the whitelist if ( $ whitelist && ! empty ( $ this -> assignable ) ) { $ columns = array_intersect_key ( $ columns , array_flip ( $ this -> assignable ) ) ; } // Remove the primary key if the model has already beed loaded if ( $ this -> isPersisted && isset ( $ columns [ $ this -> primaryKey ] ) ) { unset ( $ columns [ $ this -> primaryKey ] ) ; } // Set column values $ this -> setColumValues ( $ columns , $ raw ) ; return $ this ; }
Assigns the column values to the model.

@param  array $columns   Column values
@param  bool  $raw       Set raw values?
@param  bool  $whitelist Remove columns that are not in the whitelist?
@return $this
Assigns the column values to the model .