code
stringlengths 15
9.96M
| docstring
stringlengths 1
10.1k
| func_name
stringlengths 1
124
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 6
186
| url
stringlengths 50
236
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
final protected function getGarbageEpoch() {
if ($this->hasAutomaticPolicy()) {
throw new Exception(
pht(
'Can not get garbage epoch for a collector with an automatic '.
'collection policy.'));
}
$ttl = $this->getRetentionPolicy();
if (!$ttl) {
throw new Exception(
pht(
'Can not get garbage epoch for a collector with an indefinite '.
'retention policy.'));
}
return (PhabricatorTime::getNow() - $ttl);
} | Get the most recent epoch timestamp that is considered garbage.
Records older than this should be collected.
@return int Most recent garbage timestamp.
@task collect | getGarbageEpoch | php | phorgeit/phorge | src/infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php | Apache-2.0 |
final public static function getAllCollectors() {
return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
->setUniqueMethod('getCollectorConstant')
->execute();
} | Load all of the available garbage collectors.
@return list<PhabricatorGarbageCollector> Garbage collectors.
@task collect | getAllCollectors | php | phorgeit/phorge | src/infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php | Apache-2.0 |
private function loadConfigVersion() {
$conn_r = id(new PhabricatorConfigEntry())->establishConnection('r');
return head(queryfx_one(
$conn_r,
'SELECT MAX(id) FROM %T',
id(new PhabricatorConfigTransaction())->getTableName()));
} | Calculate a version number for the current Phabricator configuration.
The version number has no real meaning and does not provide any real
indication of whether a configuration entry has been changed. The config
version is intended to be a rough indicator that "something has changed",
which indicates to the overseer that the daemons should be reloaded.
@return int | loadConfigVersion | php | phorgeit/phorge | src/infrastructure/daemon/overseer/PhabricatorDaemonOverseerModule.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/overseer/PhabricatorDaemonOverseerModule.php | Apache-2.0 |
private function updateConfigVersion() {
$old_version = $this->configVersion;
$new_version = $this->loadConfigVersion();
$this->configVersion = $new_version;
// Don't trigger a reload if we're loading the config for the very
// first time.
if ($old_version === null) {
return false;
}
return ($old_version != $new_version);
} | Check and update the configuration version.
@return bool True if the daemons should restart, otherwise false. | updateConfigVersion | php | phorgeit/phorge | src/infrastructure/daemon/overseer/PhabricatorDaemonOverseerModule.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/overseer/PhabricatorDaemonOverseerModule.php | Apache-2.0 |
public function getRequiredLeaseTime() {
return null;
} | Return the number of seconds this worker needs hold a lease on the task for
while it performs work. For most tasks you can leave this at `null`, which
will give you a default lease (currently 2 hours).
For tasks which may take a very long time to complete, you should return
an upper bound on the amount of time the task may require.
@return int|null Number of seconds this task needs to remain leased for,
or null for a default lease.
@task config | getRequiredLeaseTime | php | phorgeit/phorge | src/infrastructure/daemon/workers/PhabricatorWorker.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/PhabricatorWorker.php | Apache-2.0 |
public function getMaximumRetryCount() {
return null;
} | Return the maximum number of times this task may be retried before it is
considered permanently failed. By default, tasks retry indefinitely. You
can throw a @{class:PhabricatorWorkerPermanentFailureException} to cause an
immediate permanent failure.
@return int|null Number of times the task will retry before permanent
failure. Return `null` to retry indefinitely.
@task config | getMaximumRetryCount | php | phorgeit/phorge | src/infrastructure/daemon/workers/PhabricatorWorker.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/PhabricatorWorker.php | Apache-2.0 |
public function getWaitBeforeRetry(PhabricatorWorkerTask $task) {
return null;
} | Return the number of seconds a task should wait after a failure before
retrying. For most tasks you can leave this at `null`, which will give you
a short default retry period (currently 60 seconds).
@param PhabricatorWorkerTask $task The task itself. This object is
probably useful mostly to examine the
failure count if you want to implement
staggered retries, or to examine the
execution exception if you want to react to
different failures in different ways.
@return int|null Number of seconds to wait between retries,
or null for a default retry period
(currently 60 seconds).
@task config | getWaitBeforeRetry | php | phorgeit/phorge | src/infrastructure/daemon/workers/PhabricatorWorker.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/PhabricatorWorker.php | Apache-2.0 |
public static function setRunAllTasksInProcess($all) {
self::$runAllTasksInProcess = $all;
} | Set this flag to execute scheduled tasks synchronously, in the same
process. This is useful for debugging, and otherwise dramatically worse
in every way imaginable. | setRunAllTasksInProcess | php | phorgeit/phorge | src/infrastructure/daemon/workers/PhabricatorWorker.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/PhabricatorWorker.php | Apache-2.0 |
final protected function getQueuedTasks() {
return $this->queuedTasks;
} | Get tasks queued as followups by @{method:queueTask}.
@return list<tuple<string, wild, int|null>> Queued task specifications. | getQueuedTasks | php | phorgeit/phorge | src/infrastructure/daemon/workers/PhabricatorWorker.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/PhabricatorWorker.php | Apache-2.0 |
final public static function awakenTaskIDs(array $ids) {
if (!$ids) {
return;
}
$table = new PhabricatorWorkerActiveTask();
$conn_w = $table->establishConnection('w');
// NOTE: At least for now, we're keeping these tasks yielded, just
// pretending that they threw a shorter yield than they really did.
// Overlap the windows here to handle minor client/server time differences
// and because it's likely correct to push these tasks to the head of their
// respective priorities. There is a good chance they are ready to execute.
$window = phutil_units('1 hour in seconds');
$epoch_ago = (PhabricatorTime::getNow() - $window);
queryfx(
$conn_w,
'UPDATE %T SET leaseExpires = %d
WHERE id IN (%Ld)
AND leaseOwner = %s
AND leaseExpires > %d
AND failureCount = 0',
$table->getTableName(),
$epoch_ago,
$ids,
self::YIELD_OWNER,
$epoch_ago);
} | Awaken tasks that have yielded.
Reschedules the specified tasks if they are currently queued in a yielded,
unleased, unretried state so they'll execute sooner. This can let the
queue avoid unnecessary waits.
This method does not provide any assurances about when these tasks will
execute, or even guarantee that it will have any effect at all.
@param list<id> $ids List of task IDs to try to awaken.
@return void | awakenTaskIDs | php | phorgeit/phorge | src/infrastructure/daemon/workers/PhabricatorWorker.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/PhabricatorWorker.php | Apache-2.0 |
private function getSleepDuration() {
$sleep = phutil_units('3 minutes in seconds');
$next_triggers = id(new PhabricatorWorkerTriggerQuery())
->setViewer($this->getViewer())
->setOrder(PhabricatorWorkerTriggerQuery::ORDER_EXECUTION)
->withNextEventBetween(0, null)
->setLimit(1)
->needEvents(true)
->execute();
if ($next_triggers) {
$next_trigger = head($next_triggers);
$next_epoch = $next_trigger->getEvent()->getNextEventEpoch();
$until = max(0, $next_epoch - PhabricatorTime::getNow());
$sleep = min($sleep, $until);
}
return $sleep;
} | Get the number of seconds to sleep for before starting the next scheduling
phase.
If no events are scheduled soon, we'll sleep briefly. Otherwise,
we'll sleep until the next scheduled event.
@return int Number of seconds to sleep for. | getSleepDuration | php | phorgeit/phorge | src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php | Apache-2.0 |
private function runGarbageCollection($duration) {
$run_until = (PhabricatorTime::getNow() + $duration);
// NOTE: We always run at least one GC cycle to make sure the GC can make
// progress even if the trigger queue is busy.
do {
$more_garbage = $this->updateGarbageCollection();
if (!$more_garbage) {
// If we don't have any more collection work to perform, we're all
// done.
break;
}
} while (PhabricatorTime::getNow() <= $run_until);
$remaining = max(0, $run_until - PhabricatorTime::getNow());
return $remaining;
} | Run the garbage collector for up to a specified number of seconds.
@param int $duration Number of seconds the GC may run for.
@return int Number of seconds remaining in the time budget.
@task garbage | runGarbageCollection | php | phorgeit/phorge | src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php | Apache-2.0 |
public function getNextEventEpoch($last_epoch, $is_reschedule) {
return $this->getClock()->getNextEventEpoch($last_epoch, $is_reschedule);
} | Return the next time this trigger should execute.
This method can be called either after the daemon executed the trigger
successfully (giving the trigger an opportunity to reschedule itself
into the future, if it is a recurring event) or after the trigger itself
is changed (usually because of an application edit). The `$is_reschedule`
parameter distinguishes between these cases.
@param int|null $last_epoch Epoch of the most recent successful event
execution.
@param bool $is_reschedule `true` if we're trying to reschedule the event
after execution; `false` if this is in response to a trigger update.
@return int|null Return an epoch to schedule the next event execution,
or `null` to stop the event from executing again. | getNextEventEpoch | php | phorgeit/phorge | src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php | Apache-2.0 |
public function executeTrigger($last_event, $this_event) {
return $this->getAction()->execute($last_event, $this_event);
} | Execute the event.
@param int|null $last_event Epoch of previous execution, or null if this
is the first execution.
@param int $this_event Scheduled epoch of this execution. This may not be
the same as the current time.
@return void | executeTrigger | php | phorgeit/phorge | src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php | Apache-2.0 |
public function getNextEventPrediction() {
// NOTE: We're basically echoing the database state here, so this won't
// necessarily be accurate if the caller just updated the object but has
// not saved it yet. That's a weird use case and would require more
// gymnastics, so don't bother trying to get it totally correct for now.
if ($this->getEvent()) {
return $this->getEvent()->getNextEventEpoch();
} else {
return $this->getNextEventEpoch(null, $is_reschedule = false);
}
} | Predict the epoch at which this trigger will next fire.
@return int|null Epoch when the event will next fire, or `null` if it is
not planned to trigger. | getNextEventPrediction | php | phorgeit/phorge | src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php | Apache-2.0 |
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
);
} | NOTE: Triggers are low-level infrastructure and do not have real
policies, but implementing the policy interface allows us to use
infrastructure like handles. | getCapabilities | php | phorgeit/phorge | src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php | Apache-2.0 |
public function setSkipLease($skip) {
$this->skipLease = $skip;
return $this;
} | Set this flag to select tasks from the top of the queue without leasing
them.
This can be used to show which tasks are coming up next without altering
the queue's behavior.
@param bool $skip True to skip the lease acquisition step. | setSkipLease | php | phorgeit/phorge | src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php | Apache-2.0 |
public function withLeasedTasks($leased) {
$this->leased = $leased;
return $this;
} | Select only leased tasks, only unleased tasks, or both types of task.
By default, queries select only unleased tasks (equivalent to passing
`false` to this method). You can pass `true` to select only leased tasks,
or `null` to ignore the lease status of tasks.
If your result set potentially includes leased tasks, you must disable
leasing using @{method:setSkipLease}. These options are intended for use
when displaying task status information.
@param mixed $leased `true` to select only leased tasks, `false` to select
only unleased tasks (default), or `null` to select both.
@return $this | withLeasedTasks | php | phorgeit/phorge | src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php | Apache-2.0 |
public function setOrder($order) {
$this->order = $order;
return $this;
} | Set the result order.
Note that using `ORDER_EXECUTION` will also filter results to include only
triggers which have been scheduled to execute. You should not use this
ordering when querying for specific triggers, e.g. by ID or PHID.
@param string $order Result order constant.
@return $this | setOrder | php | phorgeit/phorge | src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php | Apache-2.0 |
final public function getStorageSourceKey() {
return $this->getApplicationName().'/'.$this->getTableName();
} | Get a key which uniquely identifies this storage source.
When loading custom fields, fields using sources with the same source key
are loaded in bulk.
@return string Source identifier. | getStorageSourceKey | php | phorgeit/phorge | src/infrastructure/customfield/storage/PhabricatorCustomFieldStorage.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/storage/PhabricatorCustomFieldStorage.php | Apache-2.0 |
public static function getObjectField(
PhabricatorCustomFieldInterface $object,
$role,
$field_key) {
$fields = self::getObjectFields($object, $role)->getFields();
return idx($fields, $field_key);
} | @task apps | getObjectField | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getFieldKey() {
if ($this->proxy) {
return $this->proxy->getFieldKey();
}
throw new PhabricatorCustomFieldImplementationIncompleteException(
$this,
$field_key_is_incomplete = true);
} | Return a key which uniquely identifies this field, like
"mycompany:dinosaur:count". Normally you should provide some level of
namespacing to prevent collisions.
@return string String which uniquely identifies this field.
@task core | getFieldKey | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getFieldName() {
if ($this->proxy) {
return $this->proxy->getFieldName();
}
return $this->getModernFieldKey();
} | Return a human-readable field name.
@return string Human readable field name.
@task core | getFieldName | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getFieldDescription() {
if ($this->proxy) {
return $this->proxy->getFieldDescription();
}
return null;
} | Return a short, human-readable description of the field's behavior. This
provides more context to administrators when they are customizing fields.
@return string|null Optional human-readable description.
@task core | getFieldDescription | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function createFields($object) {
return array($this);
} | Most field implementations are unique, in that one class corresponds to
one field. However, some field implementations are general and a single
implementation may drive several fields.
For general implementations, the general field implementation can return
multiple field instances here.
@param object $object The object to create fields for.
@return list<PhabricatorCustomField> List of fields.
@task core | createFields | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function isFieldEnabled() {
if ($this->proxy) {
return $this->proxy->isFieldEnabled();
}
return true;
} | You can return `false` here if the field should not be enabled for any
role. For example, it might depend on something (like an application or
library) which isn't installed, or might have some global configuration
which allows it to be disabled.
@return bool False to completely disable this field for all roles.
@task core | isFieldEnabled | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldEnableForRole($role) {
// NOTE: All of these calls proxy individually, so we don't need to
// proxy this call as a whole.
switch ($role) {
case self::ROLE_APPLICATIONTRANSACTIONS:
return $this->shouldAppearInApplicationTransactions();
case self::ROLE_APPLICATIONSEARCH:
return $this->shouldAppearInApplicationSearch();
case self::ROLE_STORAGE:
return $this->shouldUseStorage();
case self::ROLE_EDIT:
return $this->shouldAppearInEditView();
case self::ROLE_VIEW:
return $this->shouldAppearInPropertyView();
case self::ROLE_LIST:
return $this->shouldAppearInListView();
case self::ROLE_GLOBALSEARCH:
return $this->shouldAppearInGlobalSearch();
case self::ROLE_CONDUIT:
return $this->shouldAppearInConduitDictionary();
case self::ROLE_TRANSACTIONMAIL:
return $this->shouldAppearInTransactionMail();
case self::ROLE_HERALD:
return $this->shouldAppearInHerald();
case self::ROLE_HERALDACTION:
return $this->shouldAppearInHeraldActions();
case self::ROLE_EDITENGINE:
return $this->shouldAppearInEditView() ||
$this->shouldAppearInEditEngine();
case self::ROLE_EXPORT:
return $this->shouldAppearInDataExport();
case self::ROLE_DEFAULT:
return true;
default:
throw new Exception(pht("Unknown field role '%s'!", $role));
}
} | Low level selector for field availability. Fields can appear in different
roles (like an edit view, a list view, etc.), but not every field needs
to appear everywhere. Fields that are disabled in a role won't appear in
that context within applications.
Normally, you do not need to override this method. Instead, override the
methods specific to roles you want to enable. For example, implement
@{method:shouldUseStorage()} to activate the `'storage'` role.
@return bool True to enable the field for the given role.
@task core | shouldEnableForRole | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function canDisableField() {
return true;
} | Allow administrators to disable this field. Most fields should allow this,
but some are fundamental to the behavior of the application and can be
locked down to avoid chaos, disorder, and the decline of civilization.
@return bool False to prevent this field from being disabled through
configuration.
@task core | canDisableField | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
final public function getFieldIndex() {
return PhabricatorHash::digestForIndex($this->getFieldKey());
} | Return an index string which uniquely identifies this field.
@return string Index string which uniquely identifies this field.
@task core | getFieldIndex | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function canSetProxy() {
if ($this instanceof PhabricatorStandardCustomFieldInterface) {
return true;
}
return false;
} | Proxies allow a field to use some other field's implementation for most
of their behavior while still subclassing an application field. When a
proxy is set for a field with @{method:setProxy}, all of its methods will
call through to the proxy by default.
This is most commonly used to implement configuration-driven custom fields
using @{class:PhabricatorStandardCustomField}.
This method must be overridden to return `true` before a field can accept
proxies.
@return bool True if you can @{method:setProxy} this field.
@task proxy | canSetProxy | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
final public function setProxy(PhabricatorCustomField $proxy) {
if (!$this->canSetProxy()) {
throw new PhabricatorCustomFieldNotProxyException($this);
}
$this->proxy = $proxy;
return $this;
} | Set the proxy implementation for this field. See @{method:canSetProxy} for
discussion of field proxies.
@param PhabricatorCustomField $proxy Field implementation.
@return $this
@task proxy | setProxy | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
final public function getProxy() {
return $this->proxy;
} | Get the field's proxy implementation, if any. For discussion, see
@{method:canSetProxy}.
@return PhabricatorCustomField|null Proxy field, if one is set.
@task proxy | getProxy | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function __clone() {
if ($this->proxy) {
$this->proxy = clone $this->proxy;
}
} | @task proxy | __clone | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
final public function setObject(PhabricatorCustomFieldInterface $object) {
if ($this->proxy) {
$this->proxy->setObject($object);
return $this;
}
$this->object = $object;
$this->didSetObject($object);
return $this;
} | Sets the object this field belongs to.
@param PhabricatorCustomFieldInterface $object The object this field
belongs to.
@return $this
@task context | setObject | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function readValueFromObject(PhabricatorCustomFieldInterface $object) {
if ($this->proxy) {
$this->proxy->readValueFromObject($object);
}
return;
} | Read object data into local field storage, if applicable.
@param PhabricatorCustomFieldInterface $object The object this field
belongs to.
@task context | readValueFromObject | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
final public function getObject() {
if ($this->proxy) {
return $this->proxy->getObject();
}
return $this->object;
} | Get the object this field belongs to.
@return PhabricatorCustomFieldInterface The object this field belongs to.
@task context | getObject | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
protected function didSetObject(PhabricatorCustomFieldInterface $object) {
return;
} | This is a hook, primarily for subclasses to load object data.
@return PhabricatorCustomFieldInterface The object this field belongs to.
@return void | didSetObject | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
final public function setViewer(PhabricatorUser $viewer) {
if ($this->proxy) {
$this->proxy->setViewer($viewer);
return $this;
}
$this->viewer = $viewer;
return $this;
} | @task context | setViewer | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
final public function getViewer() {
if ($this->proxy) {
return $this->proxy->getViewer();
}
return $this->viewer;
} | @task context | getViewer | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
final protected function requireViewer() {
if ($this->proxy) {
return $this->proxy->requireViewer();
}
if (!$this->viewer) {
throw new PhabricatorCustomFieldDataNotAvailableException($this);
}
return $this->viewer;
} | @task context | requireViewer | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function newStorageObject() {
// NOTE: This intentionally isn't proxied, to avoid call cycles.
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Return a new, empty storage object. This should be a subclass of
@{class:PhabricatorCustomFieldStorage} which is bound to the application's
database.
@return PhabricatorCustomFieldStorage New empty storage object.
@task storage | newStorageObject | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getValueForStorage() {
if ($this->proxy) {
return $this->proxy->getValueForStorage();
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Return a serialized representation of the field value, appropriate for
storing in auxiliary field storage. You must implement this method if
you implement @{method:shouldUseStorage}.
If the field value is a scalar, it can be returned unmodified. If not,
it should be serialized (for example, using JSON).
@return string|null Serialized field value.
@task storage | getValueForStorage | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function setValueFromStorage($value) {
if ($this->proxy) {
return $this->proxy->setValueFromStorage($value);
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Set the field's value given a serialized storage value. This is called
when the field is loaded; if no data is available, the value will be
null. You must implement this method if you implement
@{method:shouldUseStorage}.
Usually, the value can be loaded directly. If it isn't a scalar, you'll
need to undo whatever serialization you applied in
@{method:getValueForStorage}.
@param string|null $value Serialized field representation (from
@{method:getValueForStorage}) or null if no value has
ever been stored.
@return $this
@task storage | setValueFromStorage | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInApplicationSearch() {
if ($this->proxy) {
return $this->proxy->shouldAppearInApplicationSearch();
}
return false;
} | Appearing in ApplicationSearch allows a field to be indexed and searched
for.
@return bool True to appear in ApplicationSearch.
@task appsearch | shouldAppearInApplicationSearch | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function buildOrderIndex() {
if ($this->proxy) {
return $this->proxy->buildOrderIndex();
}
return null;
} | Return an index against which this field can be meaningfully ordered
against to implement ApplicationSearch.
This should be a single index, normally built using
@{method:newStringIndex} and @{method:newNumericIndex}.
The value of the index is not used.
@return PhabricatorCustomFieldIndexStorage|null A single index to order
by, or null if this field cannot be ordered.
@task appsearch | buildOrderIndex | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
protected function newStringIndexStorage() {
// NOTE: This intentionally isn't proxied, to avoid call cycles.
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Build a new empty storage object for storing string indexes. Normally,
this should be a concrete subclass of
@{class:PhabricatorCustomFieldStringIndexStorage}.
@return PhabricatorCustomFieldStringIndexStorage Storage object.
@task appsearch | newStringIndexStorage | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
protected function newNumericIndexStorage() {
// NOTE: This intentionally isn't proxied, to avoid call cycles.
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Build a new empty storage object for storing string indexes. Normally,
this should be a concrete subclass of
@{class:PhabricatorCustomFieldStringIndexStorage}.
@return PhabricatorCustomFieldStringIndexStorage Storage object.
@task appsearch | newNumericIndexStorage | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
protected function newStringIndex($value) {
if ($this->proxy) {
return $this->proxy->newStringIndex();
}
$key = $this->getFieldIndex();
return $this->newStringIndexStorage()
->setIndexKey($key)
->setIndexValue($value);
} | Build and populate storage for a string index.
@param string $value String to index.
@return PhabricatorCustomFieldStringIndexStorage Populated storage.
@task appsearch | newStringIndex | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
protected function newNumericIndex($value) {
if ($this->proxy) {
return $this->proxy->newNumericIndex();
}
$key = $this->getFieldIndex();
return $this->newNumericIndexStorage()
->setIndexKey($key)
->setIndexValue($value);
} | Build and populate storage for a numeric index.
@param string $value Numeric value to index.
@return PhabricatorCustomFieldNumericIndexStorage Populated storage.
@task appsearch | newNumericIndex | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function readApplicationSearchValueFromRequest(
PhabricatorApplicationSearchEngine $engine,
AphrontRequest $request) {
if ($this->proxy) {
return $this->proxy->readApplicationSearchValueFromRequest(
$engine,
$request);
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Read a query value from a request, for storage in a saved query. Normally,
this method should, e.g., read a string out of the request.
@param PhabricatorApplicationSearchEngine $engine Engine building the
query.
@param AphrontRequest $request Request to read from.
@return wild
@task appsearch | readApplicationSearchValueFromRequest | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function applyApplicationSearchConstraintToQuery(
PhabricatorApplicationSearchEngine $engine,
PhabricatorCursorPagedPolicyAwareQuery $query,
$value) {
if ($this->proxy) {
return $this->proxy->applyApplicationSearchConstraintToQuery(
$engine,
$query,
$value);
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Constrain a query, given a field value. Generally, this method should
use `with...()` methods to apply filters or other constraints to the
query.
@param PhabricatorApplicationSearchEngine $engine Engine executing the
query.
@param PhabricatorCursorPagedPolicyAwareQuery $query Query to constrain.
@param wild $value Constraint provided by the user.
@return void
@task appsearch | applyApplicationSearchConstraintToQuery | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form,
$value) {
if ($this->proxy) {
return $this->proxy->appendToApplicationSearchForm(
$engine,
$form,
$value);
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Append search controls to the interface.
@param PhabricatorApplicationSearchEngine $engine Engine constructing the
form.
@param AphrontFormView $form The form to update.
@param wild $value Value from the saved query.
@return void
@task appsearch | appendToApplicationSearchForm | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInApplicationTransactions() {
if ($this->proxy) {
return $this->proxy->shouldAppearInApplicationTransactions();
}
return false;
} | Appearing in ApplicationTransactions allows a field to be edited using
standard workflows.
@return bool True to appear in ApplicationTransactions.
@task appxaction | shouldAppearInApplicationTransactions | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getApplicationTransactionType() {
if ($this->proxy) {
return $this->proxy->getApplicationTransactionType();
}
return PhabricatorTransactions::TYPE_CUSTOMFIELD;
} | @task appxaction | getApplicationTransactionType | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getApplicationTransactionMetadata() {
if ($this->proxy) {
return $this->proxy->getApplicationTransactionMetadata();
}
return array();
} | @task appxaction | getApplicationTransactionMetadata | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getOldValueForApplicationTransactions() {
if ($this->proxy) {
return $this->proxy->getOldValueForApplicationTransactions();
}
return $this->getValueForStorage();
} | @task appxaction | getOldValueForApplicationTransactions | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getNewValueForApplicationTransactions() {
if ($this->proxy) {
return $this->proxy->getNewValueForApplicationTransactions();
}
return $this->getValueForStorage();
} | @task appxaction | getNewValueForApplicationTransactions | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function setValueFromApplicationTransactions($value) {
if ($this->proxy) {
return $this->proxy->setValueFromApplicationTransactions($value);
}
return $this->setValueFromStorage($value);
} | @task appxaction | setValueFromApplicationTransactions | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getNewValueFromApplicationTransactions(
PhabricatorApplicationTransaction $xaction) {
if ($this->proxy) {
return $this->proxy->getNewValueFromApplicationTransactions($xaction);
}
return $xaction->getNewValue();
} | @task appxaction | getNewValueFromApplicationTransactions | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getApplicationTransactionHasEffect(
PhabricatorApplicationTransaction $xaction) {
if ($this->proxy) {
return $this->proxy->getApplicationTransactionHasEffect($xaction);
}
return ($xaction->getOldValue() !== $xaction->getNewValue());
} | @task appxaction | getApplicationTransactionHasEffect | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function applyApplicationTransactionInternalEffects(
PhabricatorApplicationTransaction $xaction) {
if ($this->proxy) {
return $this->proxy->applyApplicationTransactionInternalEffects($xaction);
}
return;
} | @task appxaction | applyApplicationTransactionInternalEffects | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getApplicationTransactionRemarkupBlocks(
PhabricatorApplicationTransaction $xaction) {
if ($this->proxy) {
return $this->proxy->getApplicationTransactionRemarkupBlocks($xaction);
}
return array();
} | @task appxaction | getApplicationTransactionRemarkupBlocks | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function applyApplicationTransactionExternalEffects(
PhabricatorApplicationTransaction $xaction) {
if ($this->proxy) {
return $this->proxy->applyApplicationTransactionExternalEffects($xaction);
}
if (!$this->shouldEnableForRole(self::ROLE_STORAGE)) {
return;
}
$this->setValueFromApplicationTransactions($xaction->getNewValue());
$value = $this->getValueForStorage();
$table = $this->newStorageObject();
$conn_w = $table->establishConnection('w');
if ($value === null) {
queryfx(
$conn_w,
'DELETE FROM %T WHERE objectPHID = %s AND fieldIndex = %s',
$table->getTableName(),
$this->getObject()->getPHID(),
$this->getFieldIndex());
} else {
queryfx(
$conn_w,
'INSERT INTO %T (objectPHID, fieldIndex, fieldValue)
VALUES (%s, %s, %s)
ON DUPLICATE KEY UPDATE fieldValue = VALUES(fieldValue)',
$table->getTableName(),
$this->getObject()->getPHID(),
$this->getFieldIndex(),
$value);
}
return;
} | @task appxaction | applyApplicationTransactionExternalEffects | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function validateApplicationTransactions(
PhabricatorApplicationTransactionEditor $editor,
$type,
array $xactions) {
if ($this->proxy) {
return $this->proxy->validateApplicationTransactions(
$editor,
$type,
$xactions);
}
return array();
} | Validate transactions for an object. This allows you to raise an error
when a transaction would set a field to an invalid value, or when a field
is required but no transactions provide value.
@param PhabricatorApplicationTransactionEditor $editor Editor applying the
transactions.
@param string $type Transaction type. This type is always
`PhabricatorTransactions::TYPE_CUSTOMFIELD`, it is provided for
convenience when constructing exceptions.
@param list<PhabricatorApplicationTransaction> $xactions Transactions
being applied, which may be empty if this field is not being edited.
@return list<PhabricatorApplicationTransactionValidationError> Validation
errors.
@task appxaction | validateApplicationTransactions | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInTransactionMail() {
if ($this->proxy) {
return $this->proxy->shouldAppearInTransactionMail();
}
return false;
} | @task xactionmail | shouldAppearInTransactionMail | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function updateTransactionMailBody(
PhabricatorMetaMTAMailBody $body,
PhabricatorApplicationTransactionEditor $editor,
array $xactions) {
if ($this->proxy) {
return $this->proxy->updateTransactionMailBody($body, $editor, $xactions);
}
return;
} | @task xactionmail | updateTransactionMailBody | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInEditView() {
if ($this->proxy) {
return $this->proxy->shouldAppearInEditView();
}
return false;
} | @task edit | shouldAppearInEditView | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInEditEngine() {
if ($this->proxy) {
return $this->proxy->shouldAppearInEditEngine();
}
return false;
} | @task edit | shouldAppearInEditEngine | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function readValueFromRequest(AphrontRequest $request) {
if ($this->proxy) {
return $this->proxy->readValueFromRequest($request);
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | @task edit | readValueFromRequest | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getRequiredHandlePHIDsForEdit() {
if ($this->proxy) {
return $this->proxy->getRequiredHandlePHIDsForEdit();
}
return array();
} | @task edit | getRequiredHandlePHIDsForEdit | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getInstructionsForEdit() {
if ($this->proxy) {
return $this->proxy->getInstructionsForEdit();
}
return null;
} | @task edit | getInstructionsForEdit | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function renderEditControl(array $handles) {
if ($this->proxy) {
return $this->proxy->renderEditControl($handles);
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | @task edit | renderEditControl | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInPropertyView() {
if ($this->proxy) {
return $this->proxy->shouldAppearInPropertyView();
}
return false;
} | @task view | shouldAppearInPropertyView | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function renderPropertyViewLabel() {
if ($this->proxy) {
return $this->proxy->renderPropertyViewLabel();
}
return $this->getFieldName();
} | @task view | renderPropertyViewLabel | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function renderPropertyViewValue(array $handles) {
if ($this->proxy) {
return $this->proxy->renderPropertyViewValue($handles);
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | @task view | renderPropertyViewValue | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getStyleForPropertyView() {
if ($this->proxy) {
return $this->proxy->getStyleForPropertyView();
}
return 'property';
} | @task view | getStyleForPropertyView | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getIconForPropertyView() {
if ($this->proxy) {
return $this->proxy->getIconForPropertyView();
}
return null;
} | @task view | getIconForPropertyView | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getRequiredHandlePHIDsForPropertyView() {
if ($this->proxy) {
return $this->proxy->getRequiredHandlePHIDsForPropertyView();
}
return array();
} | @task view | getRequiredHandlePHIDsForPropertyView | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInListView() {
if ($this->proxy) {
return $this->proxy->shouldAppearInListView();
}
return false;
} | @task list | shouldAppearInListView | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function renderOnListItem(PHUIObjectItemView $view) {
if ($this->proxy) {
return $this->proxy->renderOnListItem($view);
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | @task list | renderOnListItem | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInGlobalSearch() {
if ($this->proxy) {
return $this->proxy->shouldAppearInGlobalSearch();
}
return false;
} | @task globalsearch | shouldAppearInGlobalSearch | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function updateAbstractDocument(
PhabricatorSearchAbstractDocument $document) {
if ($this->proxy) {
return $this->proxy->updateAbstractDocument($document);
}
return $document;
} | @task globalsearch | updateAbstractDocument | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInConduitDictionary() {
if ($this->proxy) {
return $this->proxy->shouldAppearInConduitDictionary();
}
return false;
} | @task conduit | shouldAppearInConduitDictionary | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getConduitDictionaryValue() {
if ($this->proxy) {
return $this->proxy->getConduitDictionaryValue();
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | @task conduit | getConduitDictionaryValue | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function shouldAppearInHerald() {
if ($this->proxy) {
return $this->proxy->shouldAppearInHerald();
}
return false;
} | Return `true` to make this field available in Herald.
@return bool True to expose the field in Herald.
@task herald | shouldAppearInHerald | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getHeraldFieldName() {
if ($this->proxy) {
return $this->proxy->getHeraldFieldName();
}
return $this->getFieldName();
} | Get the name of the field in Herald. By default, this uses the
normal field name.
@return string Herald field name.
@task herald | getHeraldFieldName | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getHeraldFieldValue() {
if ($this->proxy) {
return $this->proxy->getHeraldFieldValue();
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Get the field value for evaluation by Herald.
@return wild Field value.
@task herald | getHeraldFieldValue | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getHeraldFieldConditions() {
if ($this->proxy) {
return $this->proxy->getHeraldFieldConditions();
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} | Get the available conditions for this field in Herald.
@return list<const> List of Herald condition constants.
@task herald | getHeraldFieldConditions | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function getHeraldFieldValueType($condition) {
if ($this->proxy) {
return $this->proxy->getHeraldFieldValueType($condition);
}
return null;
} | Get the Herald value type for the given condition.
@param string $condition Herald condition constant.
@return string|null Herald value type constant, or null to use the
default.
@task herald | getHeraldFieldValueType | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomField.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomField.php | Apache-2.0 |
public function readFieldsFromStorage(
PhabricatorCustomFieldInterface $object) {
$this->readFieldsFromObject($object);
$fields = $this->getFields();
id(new PhabricatorCustomFieldStorageQuery())
->addFields($fields)
->execute();
return $this;
} | Read stored values for all fields which support storage.
@param PhabricatorCustomFieldInterface $object Object to read field values
for.
@return void | readFieldsFromStorage | php | phorgeit/phorge | src/infrastructure/customfield/field/PhabricatorCustomFieldList.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php | Apache-2.0 |
public function applyApplicationSearchConstraintToQuery(
PhabricatorApplicationSearchEngine $engine,
PhabricatorCursorPagedPolicyAwareQuery $query,
$value) {
// The basic use case is with a single value.
// The backend really works with an array. So also array allowed.
if (is_array($value) || phutil_nonempty_scalar($value)) {
$value = (array)$value;
if ($value) {
$query->withApplicationSearchContainsConstraint(
$this->newNumericIndex(null),
$value);
}
}
} | Apply an application search constraint to a query.
If you have a field of type integer, and a value (or an array of values),
the result set will be limited to the rows with these values.
@param PhabricatorApplicationSearchEngine $engine
@param PhabricatorCursorPagedPolicyAwareQuery $query
@param mixed $value Single value or array of values (IN query). | applyApplicationSearchConstraintToQuery | php | phorgeit/phorge | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php | Apache-2.0 |
protected function getMethodNameGrammarSet() {
$funcnames = head(parent::getFuncNameGrammarSet());
return $this->buildGrammarSet('methodname', $funcnames);
} | Renamed from `funcname` | getMethodNameGrammarSet | php | phorgeit/phorge | src/infrastructure/lipsum/code/PhutilJavaCodeSnippetContextFreeGrammar.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/lipsum/code/PhutilJavaCodeSnippetContextFreeGrammar.php | Apache-2.0 |
protected function getClassDeclGrammarSet() {
return $this->buildGrammarSet('classdecl',
array(
'[classinheritancemod] class [classname] {[classbody, indent, block]}',
'class [classname] {[classbody, indent, block]}',
));
} | Not really C, but put it here because of the curly braces and mostly shared
among Java and PHP | getClassDeclGrammarSet | php | phorgeit/phorge | src/infrastructure/lipsum/code/PhutilCLikeCodeSnippetContextFreeGrammar.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/lipsum/code/PhutilCLikeCodeSnippetContextFreeGrammar.php | Apache-2.0 |
protected function getMethodInheritanceModGrammarSet() {
return $this->buildGrammarSet('methodinheritancemod',
array(
'final',
));
} | Keeping this separate so we won't give abstract methods a function body | getMethodInheritanceModGrammarSet | php | phorgeit/phorge | src/infrastructure/lipsum/code/PhutilCLikeCodeSnippetContextFreeGrammar.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/lipsum/code/PhutilCLikeCodeSnippetContextFreeGrammar.php | Apache-2.0 |
public function isAvailable() {
return false;
} | Determine if the cache is available. For example, the APCu cache tests if
APCu is installed. If this method returns false, the cache is not
operational and can not be used.
@return bool True if the cache can be used.
@task kvimpl | isAvailable | php | phorgeit/phorge | src/infrastructure/cache/PhutilKeyValueCache.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/cache/PhutilKeyValueCache.php | Apache-2.0 |
final public function getKey($key, $default = null) {
$map = $this->getKeys(array($key));
return idx($map, $key, $default);
} | Get a single key from cache. See @{method:getKeys} to get multiple keys at
once.
@param string $key Key to retrieve.
@param wild $default (optional) Value to return if the key is not
found. By default, returns null.
@return wild Cache value (on cache hit) or default value (on cache
miss).
@task kvimpl | getKey | php | phorgeit/phorge | src/infrastructure/cache/PhutilKeyValueCache.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/cache/PhutilKeyValueCache.php | Apache-2.0 |
final public function setKey($key, $value, $ttl = null) {
return $this->setKeys(array($key => $value), $ttl);
} | Set a single key in cache. See @{method:setKeys} to set multiple keys at
once.
See @{method:setKeys} for a description of TTLs.
@param string $key Key to set.
@param wild $value Value to set.
@param int|null $ttl (optional) TTL.
@return $this
@task kvimpl | setKey | php | phorgeit/phorge | src/infrastructure/cache/PhutilKeyValueCache.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/cache/PhutilKeyValueCache.php | Apache-2.0 |
final public function deleteKey($key) {
return $this->deleteKeys(array($key));
} | Delete a key from the cache. See @{method:deleteKeys} to delete multiple
keys at once.
@param string $key Key to delete.
@return $this
@task kvimpl | deleteKey | php | phorgeit/phorge | src/infrastructure/cache/PhutilKeyValueCache.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/cache/PhutilKeyValueCache.php | Apache-2.0 |
public function setCaches(array $caches) {
assert_instances_of($caches, 'PhutilKeyValueCache');
$this->cachesForward = $caches;
$this->cachesBackward = array_reverse($caches);
return $this;
} | Set the caches which comprise this stack.
@param list<PhutilKeyValueCache> $caches Ordered list of key-value
caches.
@return $this
@task config | setCaches | php | phorgeit/phorge | src/infrastructure/cache/PhutilKeyValueCacheStack.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/cache/PhutilKeyValueCacheStack.php | Apache-2.0 |
private function getConnection($server) {
if (empty($this->connections[$server])) {
$spec = $this->servers[$server];
$host = $spec['host'];
$port = $spec['port'];
$conn = memcache_pconnect($host, $spec['port']);
if (!$conn) {
throw new Exception(
pht(
'Unable to connect to memcache server (%s:%d)!',
$host,
$port));
}
$this->connections[$server] = $conn;
}
return $this->connections[$server];
} | @phutil-external-symbol function memcache_pconnect | getConnection | php | phorgeit/phorge | src/infrastructure/cache/PhutilMemcacheKeyValueCache.php | https://github.com/phorgeit/phorge/blob/master/src/infrastructure/cache/PhutilMemcacheKeyValueCache.php | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.