CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • ConnectionManager
  • ConnectionRegistry
  • FactoryLocator
  • Paginator
  • QueryCacher
  • ResultSetDecorator
  • RulesChecker

Interfaces

  • ConnectionInterface
  • EntityInterface
  • FixtureInterface
  • InvalidPropertyInterface
  • PaginatorInterface
  • QueryInterface
  • RepositoryInterface
  • ResultSetInterface
  • SchemaInterface
  • TableSchemaInterface

Traits

  • EntityTrait
  • ModelAwareTrait
  • QueryTrait
  • RulesAwareTrait

Trait RulesAwareTrait

A trait that allows a class to build and apply application. rules.

If the implementing class also implements EventAwareTrait, then events will be emitted when rules are checked.

The implementing class is expected to define the RULES_CLASS constant if they need to customize which class is used for rules objects.

Direct Users

  • Cake\ORM\Table
Namespace: Cake\Datasource
Location: Datasource/RulesAwareTrait.php

Properties summary

  • $_rulesChecker protected
    Cake\Datasource\RulesChecker
    The domain rules to be applied to entities saved by this table

Method Summary

  • buildRules() public
    Returns a RulesChecker object after modifying the one that was supplied.
  • checkRules() public

    Returns whether or not the passed entity complies with all the rules stored in the rules checker.

  • rulesChecker() public
    Returns the RulesChecker for this instance.

Method Detail

buildRules() public ¶

buildRules( Cake\Datasource\RulesChecker $rules )

Returns a RulesChecker object after modifying the one that was supplied.

Subclasses should override this method in order to initialize the rules to be applied to entities saved by this instance.

Parameters
Cake\Datasource\RulesChecker $rules
The rules object to be modified.
Returns
Cake\Datasource\RulesChecker

checkRules() public ¶

checkRules( Cake\Datasource\EntityInterface $entity , string $operation = RulesChecker::CREATE , ArrayObject|array|null $options = null )

Returns whether or not the passed entity complies with all the rules stored in the rules checker.

Parameters
Cake\Datasource\EntityInterface $entity
The entity to check for validity.
string $operation optional RulesChecker::CREATE
The operation being run. Either 'create', 'update' or 'delete'.
ArrayObject|array|null $options optional null
The options To be passed to the rules.
Returns
boolean

rulesChecker() public ¶

rulesChecker( )

Returns the RulesChecker for this instance.

A RulesChecker object is used to test an entity for validity on rules that may involve complex logic or data that needs to be fetched from relevant datasources.

Returns
Cake\Datasource\RulesChecker
See
Cake\Datasource\RulesChecker

Properties detail

$_rulesChecker ¶

protected Cake\Datasource\RulesChecker

The domain rules to be applied to entities saved by this table

Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs