Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem recovering datas by Regex #43

Open
Max2817 opened this issue Sep 16, 2010 · 1 comment
Open

Problem recovering datas by Regex #43

Max2817 opened this issue Sep 16, 2010 · 1 comment

Comments

@Max2817
Copy link

Max2817 commented Sep 16, 2010

Hi M. Pearson,

Thanks for your php Library, I use and like it. But I have a little problem, I would like to use your example :
"// By pluggable 'Clause'
$c = new PandraColumnFamily();
$c['username'] = 'myuser';
$c['homeAddress'] = ' MY HOUSE ';
$c['phone'] = '987654231';
$c['mobile'] = '011465987';
$c['workAddress'] = ' MY WORK ';

// regex extraction column references ending in 'address'
// (ie: homeAddress and workAddress)
$q = new PandraQuery();
$addresses = $c[$q->Regex('/address$/i')];
foreach ($addresses as $addressColumn) {
echo "QUERIED PATH : ".$addressColumn->value."
";
}"

But I have this error :
"Catchable fatal error: Object of class PandraQuery could not be converted to string in /Pandra/lib/ColumnContainer.class.php on line 779"

Do you know a way to fix this problem ?

Thanks for your answer,

Nicolas

@mjpearson
Copy link
Owner

Hi Nicolas, yes I have a fix for that, Query is a work in progress and doesn't work the same way since the last update. To extract columns from an already loaded column family, you need to instantiate a 'PandraClause' type (lib/query/Clause*.class.php)

The addresses line should be :

$addresses = $c[new PandraClauseRegex('/address$/i')];

I'll update the documentation, sorry for the confusion
-michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants