Path: blob/master/src/infrastructure/storage/lisk/PhabricatorDataNotAttachedException.php
12241 views
<?php12final class PhabricatorDataNotAttachedException extends Exception {34public function __construct($object) {5$stack = debug_backtrace();67// Shift off `PhabricatorDataNotAttachedException::__construct()`.8array_shift($stack);9// Shift off `PhabricatorLiskDAO::assertAttached()`.10array_shift($stack);1112$frame = head($stack);13$via = null;14if (is_array($frame)) {15$method = idx($frame, 'function');16if (preg_match('/^get[A-Z]/', $method)) {17$via = ' '.pht('(via %s)', "{$method}()");18}19}2021parent::__construct(22pht(23"Attempting to access attached data on %s, but the data is not ".24"actually attached. Before accessing attachable data on an object, ".25"you must load and attach it.\n\n".26"Data is normally attached by calling the corresponding %s method on ".27"the Query class when the object is loaded. You can also call the ".28"corresponding %s method explicitly.",29get_class($object).$via,30'needX()',31'attachX()'));32}3334}353637