Class Kohana_ORM_Behavior

Kohana_ORM_Behavior

package
Kohana/ORM
author
Koseven Team
copyright
(c) 2016-2018 Koseven Team
license
https://koseven.ga/LICENSE.md


Properties

protected Database_Query_Builder_Select $_config

Database query builder

Default value:
NULL

Methods

public static factory(string $behavior [, mixed $config = NULL ] ) (defined in Kohana_ORM_Behavior)

Creates and returns a new ORM behavior.

Parameters

  • string $behavior required - $type Type name
  • mixed $config = NULL - $id Parameter for find()

Tags

  • Chainable -

Return Values

  • ORM

Source Code

public static function factory($behavior, $config = NULL)
{
	if ( ! is_string($behavior) AND is_array($config))
	{
		if ( ! is_callable($config))
			throw new Kohana_Exception('Behavior cannot be created: function does not exists');

		// This is either a callback as an array or a lambda
		return new ORM_Behavior_LocalBehavior($config);
	}

	// Set class name
	$behavior_name = 'ORM_Behavior_'.ucfirst($behavior);

	return new $behavior_name($config);
}

public on_construct() (defined in Kohana_ORM_Behavior)

Source Code

public function on_construct($model, $id) { return TRUE; }

public on_create() (defined in Kohana_ORM_Behavior)

Source Code

public function on_create($model) { }

public on_update() (defined in Kohana_ORM_Behavior)

Source Code

public function on_update($model) { }

protected __construct() (defined in Kohana_ORM_Behavior)

Source Code

protected function __construct($config)
{
	$this->_config = $config;
}

Do you want to contribute to Koseven?

We need YOUR help!

This project is open source. What does this mean? YOU can help:
  • Found a bug? Report it on Github
  • Need a feature? Add it Here
  • Want to help? Join the Forum
Go to Github