cehlo Posted March 23, 2020 Share Posted March 23, 2020 Hi guys, just one shor question maybe just for my insight. When we are using PageArray like array of pages, it is possible to have same page in there twice? Specific problem - I had created method to generate pedigree of dog with 30 ancestors. It is PageArray and order of pages / dogs is important here to generate fronted output. So, You know dogs are not very monogamic and inside one pedigree it is possible that one male ancestor is there multiple times. So problem is that during generation of this PageArray, when there is second occurence of same page / ancestor, first will disapper. So my question is - is not possible to have same page multiple times in Page Array or should I look for some errors in my code (which I did not find for now) ? <?php // It is not same code, but this is all according to manipulation with pageArray I am using when I am creating PageArray $pedigree = new PageArray(); $pedigree->add($ancestor_page); ?> Thank you for your answers. Cheers B. Link to comment Share on other sites More sharing options...
MoritzLost Posted March 23, 2020 Share Posted March 23, 2020 PageArray inherits from PaginatedArray which inherits from WireArray. WireArray checks for duplicates by default. You can change this behaviour through setDuplicateChecking! 6 Link to comment Share on other sites More sharing options...
cehlo Posted March 23, 2020 Author Share Posted March 23, 2020 Thank you, that save my day :). Link to comment Share on other sites More sharing options...
JAMES77 Posted March 24, 2020 Share Posted March 24, 2020 Thank you for sharing duplicates check software. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now