Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Nov 16, 2022
2 parents 217ea6f + 22cbd1e commit d1f413f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"ColdBox ORM Extensions",
"version":"4.2.0",
"version":"4.3.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cborm/@build.version@/[email protected]@.zip",
"author":"Ortus Solutions <[email protected]",
"homepage":"https://github.com/coldbox-modules/cborm",
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

----

## [v4.3.0] => 2022-NOV-16

### Changed

* Updated `processState()` to `announce()` to stay compliant

----

## [v4.2.0] => 2022-NOV-16

### Changed
Expand Down
4 changes: 2 additions & 2 deletions models/BaseORMService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ component accessors="true" {
if ( getEventHandling() ) {
getORMEventHandler()
.getEventManager()
.processState(
.announce(
"beforeOrmExecuteQuery",
{
"query" : arguments.query,
Expand All @@ -443,7 +443,7 @@ component accessors="true" {
if ( getEventHandling() ) {
getORMEventHandler()
.getEventManager()
.processState(
.announce(
"afterOrmExecuteQuery",
{
"query" : arguments.query,
Expand Down
14 changes: 7 additions & 7 deletions models/criterion/BaseBuilder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ component accessors="true" {

// process interception
if ( ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Order", "criteriaBuilder" : this }
);
Expand Down Expand Up @@ -209,7 +209,7 @@ component accessors="true" {

// announce
if ( ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Alias", "criteriaBuilder" : this }
);
Expand Down Expand Up @@ -242,7 +242,7 @@ component accessors="true" {
nativeCriteria = nativeCriteria.createCriteria( arguments.associationName, arguments.joinType );
// announce
if ( ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{
"type" : "New Criteria w/Join Type",
Expand Down Expand Up @@ -281,7 +281,7 @@ component accessors="true" {
}
}
if ( ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "New Criteria", "criteriaBuilder" : this }
);
Expand Down Expand Up @@ -351,7 +351,7 @@ component accessors="true" {

// announce
if ( ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Projection", "criteriaBuilder" : this }
);
Expand Down Expand Up @@ -482,7 +482,7 @@ component accessors="true" {

// announce
if ( ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Projection", "criteriaBuilder" : this }
);
Expand Down Expand Up @@ -716,7 +716,7 @@ component accessors="true" {

// announce
if ( ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Projection", "criteriaBuilder" : this }
);
Expand Down
24 changes: 12 additions & 12 deletions models/criterion/CriteriaBuilder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {

// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState( "beforeCriteriaBuilderList", { "criteriaBuilder" : this } );
variables.eventManager.announce( "beforeCriteriaBuilderList", { "criteriaBuilder" : this } );
}

// Get listing
var results = variables.nativeCriteria.list() ?: [];

// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"afterCriteriaBuilderList",
{ "criteriaBuilder" : this, "results" : results }
);
Expand All @@ -176,7 +176,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {
/**
* pass off arguments to higher-level restriction builder, and handle the results
*
* @missingMethodName
* @missingMethodName
* @missingMethodArguments
*/
any function onMissingMethod( required string missingMethodName, required struct missingMethodArguments ){
Expand All @@ -194,7 +194,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {

// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Restriction", "criteriaBuilder" : this }
);
Expand All @@ -220,7 +220,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {

// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Subquery", "criteriaBuilder" : this }
);
Expand Down Expand Up @@ -284,7 +284,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {
if ( getSqlHelper().canLogLimitOffset() ) {
// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Offset", "criteriaBuilder" : this }
);
Expand All @@ -303,7 +303,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {
if ( getSqlHelper().canLogLimitOffset() ) {
// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Max", "criteriaBuilder" : this }
);
Expand Down Expand Up @@ -372,7 +372,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {
any function get( properties = "" ){
// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState( "beforeCriteriaBuilderGet", { "criteriaBuilder" : this } );
variables.eventManager.announce( "beforeCriteriaBuilderGet", { "criteriaBuilder" : this } );
}

// Do we have any properties to add?
Expand All @@ -385,7 +385,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {

// process interception
if ( !isNull( result ) && variables.ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"afterCriteriaBuilderGet",
{ "criteriaBuilder" : this, "result" : result }
);
Expand All @@ -404,7 +404,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {
numeric function count( propertyName = "" ){
// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState( "beforeCriteriaBuilderCount", { "criteriaBuilder" : this } );
variables.eventManager.announce( "beforeCriteriaBuilderCount", { "criteriaBuilder" : this } );
}

// else project on the local criterias
Expand All @@ -416,7 +416,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {

// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Count", "criteriaBuilder" : this }
);
Expand All @@ -429,7 +429,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {

// process interception
if ( variables.ORMService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"afterCriteriaBuilderCount",
{ "criteriaBuilder" : this, "results" : results }
);
Expand Down
6 changes: 3 additions & 3 deletions models/criterion/DetachedCriteriaBuilder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {
/**
* pass off arguments to higher-level restriction builder, and handle the results
*
* @missingMethodName
* @missingMethodName
* @missingMethodArguments
*/
any function onMissingMethod( required string missingMethodName, required struct missingMethodArguments ){
Expand All @@ -76,7 +76,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {
default:
nativeCriteria.add( r );
// process interception
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{
"type" : "Subquery Restriction",
Expand Down Expand Up @@ -182,7 +182,7 @@ component accessors="true" extends="cborm.models.criterion.BaseBuilder" {
if ( getSqlHelper().canLogLimitOffset() ) {
// process interception
if ( variables.ormService.getEventHandling() ) {
variables.eventManager.processState(
variables.eventManager.announce(
"onCriteriaBuilderAddition",
{ "type" : "Max", "criteriaBuilder" : this }
);
Expand Down

0 comments on commit d1f413f

Please sign in to comment.