Skip to content

Instantly share code, notes, and snippets.

View pspanja's full-sized avatar

Petar Španja pspanja

View GitHub Profile
@pspanja
pspanja / papi_bootstrap.php
Created September 5, 2012 09:45
Public API boostrap
<?php
/**
* @var \eZ\Publish\API\Container $serviceContainer
*/
$serviceContainer = require "bootstrap.php";
/**
* @var $repository \eZ\Publish\API\Repository\Repository
*/
@pspanja
pspanja / create_content_type.php
Created September 5, 2012 09:48
Create ContentType
<?php
/**
* @var \eZ\Publish\API\Container $serviceContainer
*/
$serviceContainer = require "bootstrap.php";
/**
* @var $repository \eZ\Publish\API\Repository\Repository
*/
@pspanja
pspanja / create_content_with_location.php
Created September 5, 2012 10:13
Create content with location
<?php
/**
* @var \eZ\Publish\API\Container $serviceContainer
*/
$serviceContainer = require "bootstrap.php";
$repository = $serviceContainer->getRepository();
$administratorUser = $repository->getUserService()->loadUser( 14 );
$repository->setCurrentUser( $administratorUser );
@pspanja
pspanja / URLInfo.php
Created September 25, 2012 11:50
URLInfo
<?php
/**
* File containing the eZ\Publish\API\Repository\Values\Content\URLAlias class.
*
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/
namespace eZ\Publish\API\Repository\Values\Content;
@pspanja
pspanja / Integration tests
Created October 8, 2012 09:52
Integration tests
PHPUnit 3.6.12 by Sebastian Bergmann.
Configuration read from /var/www/ezp-next/eZ/Publish/API/Repository/Tests/phpunit-legacy.xml
............................................................. 61 / 1273 ( 4%)
............................................................. 122 / 1273 ( 9%)
............................................................. 183 / 1273 ( 14%)
............................................................. 244 / 1273 ( 19%)
............................................................. 305 / 1273 ( 23%)
............................................................. 366 / 1273 ( 28%)
<?php
/**
* File containing the Content FieldHandler class
*
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/
namespace eZ\Publish\Core\Persistence\Legacy\Content;
<?php
/**
* File containing the SiteHelper class.
*
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/
namespace eZ\Publish\Core\Helper;
Example of Criterions not relating to each other:
There is a Content with two Locations: Location A and Location B
- Location A is visible
- Location B is hidden
Searching with LocationId criterion with Location B id and Visibility
criterion with Visibility::VISIBLE will return the Content because
conditions are satisfied:
diff --git a/eZ/Publish/Core/Repository/URLAliasService.php b/eZ/Publish/Core/Repository/URLAliasService.php
index 065956e..348a9a5 100644
--- a/eZ/Publish/Core/Repository/URLAliasService.php
+++ b/eZ/Publish/Core/Repository/URLAliasService.php
@@ -257,8 +257,23 @@ class URLAliasService implements URLAliasServiceInterface
*/
protected function selectAliasLanguageCode( SPIURLAlias $spiUrlAlias, $languageCode )
{
- if ( isset( $languageCode ) && !in_array( $languageCode, $spiUrlAlias->languageCodes ) )
+ if ( isset( $languageCode ) )
<?php
class PageController extends Controller
{
...
/**
*
*
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException