src/Database/ORM/Traits/QueryBuilding.php
/**
	 * Creates a new row in the database and returns the model.
	 *
	 * @param array $values
	 * @param int $code
	 * @return static
	 */
Creates a new row in the database and returns the model.
@param array $values
@param int $code
@return static
Creates a new row in the database and returns the model . @param array $values @param int $code @return static
public static function create(array $values) {
		$o = (new static);
		$table = $o->getTable();
		$builder = DB::connection($o->getConnection())->insert()->into($table)->values($values);
		$id = $builder->exec();
		if (!$id) {
			return null;
		}
		return static::find($id);
	}
public static function create ( array $ values ) { $ o = ( new static ) ; $ table = $ o -> getTable ( ) ; $ builder = DB :: connection ( $ o -> getConnection ( ) ) -> insert ( ) -> into ( $ table ) -> values ( $ values ) ; $ id = $ builder -> exec ( ) ; if ( ! $ id ) { return null ; } return static :: find ( $ id ) ; }
Creates a new row in the database and returns the model.
Creates a new row in the database and returns the model .