Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1748
Get CustomField for Project
Active
Public
Actions
Authored by
devurandom
on Apr 1 2015, 3:27 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
function
getField
(
$object
,
$id
,
$user
)
{
$fields
=
PhabricatorCustomField
::
getObjectFields
(
$object
,
PhabricatorCustomField
::
ROLE_VIEW
)
->
setViewer
(
$user
)
->
readFieldsFromStorage
(
$object
)
->
getFields
();
$field
=
$fields
[
$id
]
->
getProxy
()
->
getFieldValue
();
return
$field
;
}
$projects
=
id
(
new
PhabricatorProjectQuery
())
->
setViewer
(
$admin
)
->
execute
();
foreach
(
$projects
as
$project
)
{
print
(
"proj: "
.
$project
->
getName
()
.
"
\n
"
);
$ldap_dn
=
getField
(
$project
,
"std:project:test"
,
$admin
);
print
(
" std:project:test = "
.
$ldap_dn
.
"
\n
"
);
}
Event Timeline
devurandom
edited the content of this paste.
(Show Details)
Apr 1 2015, 3:27 PM
2015-04-01 15:27:57 (UTC+0)
devurandom
changed the title of this paste from untitled to
Get CustomField for Project
.
devurandom
updated the paste's language from
autodetect
to
php
.
devurandom
edited the content of this paste.
(Show Details)
Apr 1 2015, 3:46 PM
2015-04-01 15:46:39 (UTC+0)
Log In to Comment