Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97244193
AlmanacQuery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 3, 18:16
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 18:16 (2 d)
Engine
blob
Format
Raw Data
Handle
23363263
Attached To
rPH Phabricator
AlmanacQuery.php
View Options
<?php
abstract
class
AlmanacQuery
extends
PhabricatorCursorPagedPolicyAwareQuery
{
protected
function
didFilterPage
(
array
$objects
)
{
if
(
head
(
$objects
)
instanceof
AlmanacPropertyInterface
)
{
// NOTE: We load properties unconditionally because CustomField assumes
// it can always generate a list of fields on an object. It may make
// sense to re-examine that assumption eventually.
$property_query
=
id
(
new
AlmanacPropertyQuery
())
->
setViewer
(
$this
->
getViewer
())
->
setParentQuery
(
$this
)
->
withObjectPHIDs
(
mpull
(
$objects
,
null
,
'getPHID'
));
// NOTE: We disable policy filtering and object attachment to avoid
// a cyclic dependency where objects need their properties and properties
// need their objects. We'll attach the objects below, and have already
// implicitly checked the necessary policies.
$property_query
->
setDisablePolicyFilteringAndAttachment
(
true
);
$properties
=
$property_query
->
execute
();
$properties
=
mgroup
(
$properties
,
'getObjectPHID'
);
foreach
(
$objects
as
$object
)
{
$object_properties
=
idx
(
$properties
,
$object
->
getPHID
(),
array
());
foreach
(
$object_properties
as
$property
)
{
$property
->
attachObject
(
$object
);
}
$object
->
attachAlmanacProperties
(
$object_properties
);
}
}
return
$objects
;
}
public
function
getQueryApplicationClass
()
{
return
'PhabricatorAlmanacApplication'
;
}
}
Event Timeline
Log In to Comment