arangodb / arangodb-php

PHP ODM for ArangoDB
https://www.arangodb.com
Apache License 2.0
183 stars 43 forks source link

Set hidden attributes is not working properly #182

Closed bankorh closed 9 years ago

bankorh commented 9 years ago

OS : Mac OS X Yosemite 10.10.4 PHP : 5.6.2 ArangoDB : 2.6.1 arangodb-php :2.5

Recently I have done something to retrieve a document from the database.

This is the record in the database.

{
    "isActive":true,
    "username":"bankorh",
    "password":"123"
}

And these are my codes.

// getDocument() is my function to get the data.
$document = getDocument($username);

// set the hidden attributes for this document.
$document->setHiddenAttributes(array(
    'password'
));

// get all the data in the document.
$result = $document->getAll();

The password should not show up in result because I have set it as hidden attribute. But the password appeared because of isActive is set to true. However, if I change the isActive to false, the password will be hidden again.

frankmayer commented 9 years ago

Thanks for reporting. Will look into it.

jsteemann commented 9 years ago

@frankmayer : currently looking into it as well and having it fixed locally. will commit soon.

frankmayer commented 9 years ago

ok :+1:

bankorh commented 9 years ago

Thank you. =D

jsteemann commented 9 years ago

Fixed in 2.5, 2.6 and devel branches.