Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/storage/AlmanacProperty.php
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | public static function newPropertyUpdateTransactions( | ||||
| $xactions = array(); | $xactions = array(); | ||||
| foreach ($properties as $name => $property) { | foreach ($properties as $name => $property) { | ||||
| if ($only_builtins && empty($builtins[$name])) { | if ($only_builtins && empty($builtins[$name])) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| $xactions[] = id(clone $template) | $xactions[] = id(clone $template) | ||||
| ->setTransactionType(AlmanacTransaction::TYPE_PROPERTY_UPDATE) | ->setTransactionType($object->getAlmanacPropertySetTransactionType()) | ||||
| ->setMetadataValue('almanac.property', $name) | ->setMetadataValue('almanac.property', $name) | ||||
| ->setNewValue($property); | ->setNewValue($property); | ||||
| } | } | ||||
| return $xactions; | return $xactions; | ||||
| } | } | ||||
| public static function newPropertyRemoveTransactions( | public static function newPropertyRemoveTransactions( | ||||
| AlmanacPropertyInterface $object, | AlmanacPropertyInterface $object, | ||||
| array $properties) { | array $properties) { | ||||
| $template = $object->getApplicationTransactionTemplate(); | $template = $object->getApplicationTransactionTemplate(); | ||||
| $xactions = array(); | $xactions = array(); | ||||
| foreach ($properties as $property) { | foreach ($properties as $property) { | ||||
| $xactions[] = id(clone $template) | $xactions[] = id(clone $template) | ||||
| ->setTransactionType(AlmanacTransaction::TYPE_PROPERTY_REMOVE) | ->setTransactionType($object->getAlmanacPropertyDeleteTransactionType()) | ||||
| ->setMetadataValue('almanac.property', $property) | ->setMetadataValue('almanac.property', $property) | ||||
| ->setNewValue(null); | ->setNewValue(null); | ||||
| } | } | ||||
| return $xactions; | return $xactions; | ||||
| } | } | ||||
| public function save() { | public function save() { | ||||
| Show All 30 Lines | |||||