/** * Get the methods that are available for mixin based * * This function conditionaly mixes the behavior. Only if the mixer * has a 'modified_by' or 'modified_by' property the behavior will * be mixed in. * * @param ObjectMixable $mixer The mixer requesting the mixable methods. * @return array An array of methods */ public function getMixableMethods(ObjectMixable $mixer = null) { $methods = array(); if ($mixer instanceof DatabaseRowInterface && ($mixer->has('modified_by') || $mixer->has('modified_on'))) { $methods = parent::getMixableMethods($mixer); } return $methods; }
/** * Get the methods that are available for mixin based * * This functions conditionaly mixes the behavior. Only if the mixer * has a 'ordering' property the behavior will be mixed in. * * @param ObjectMixable $mixer The mixer requesting the mixable methods. * @return array An array of methods */ public function getMixableMethods(ObjectMixable $mixer = null) { $methods = array(); if ($mixer instanceof DatabaseRowInterface && $mixer->has('ordering')) { $methods = parent::getMixableMethods($mixer); } return $methods; }
/** * Perform the actual mixin of all registered mixins for an object * * @param ObjectIdentifier $identifier * @param ObjectMixable $mixer * @return ObjectMixable The mixed object */ protected function _mixin(ObjectIdentifier $identifier, $mixer) { if ($mixer instanceof ObjectMixable) { $mixins = $identifier->getMixins(); foreach ($mixins as $mixin) { $mixer->mixin($mixin); } } return $mixer; }
/** * Perform the actual mixin of all registered mixins for an object * * @param ObjectIdentifier $identifier * @param ObjectMixable $mixer * @return ObjectMixable The mixed object */ protected function _mixin(ObjectIdentifier $identifier, $mixer) { if ($mixer instanceof ObjectMixable) { $mixins = $identifier->getMixins(); foreach ($mixins as $key => $value) { if (is_numeric($key)) { $mixer->mixin($value); } else { $mixer->mixin($key, $value); } } } return $mixer; }