diff options
| author | wjames5 <will@tekimaki.com> | 2010-03-06 23:47:39 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2010-03-06 23:47:39 +0000 |
| commit | 38504ded1d9f1a23dfd8c454e7558e2a8e611e33 (patch) | |
| tree | dfb79b3968273ec77b0a8e4f1255fb37e60635e6 | |
| parent | 7318f898cff209bb239663245b2c81a7befb2f6b (diff) | |
| download | liberty-38504ded1d9f1a23dfd8c454e7558e2a8e611e33.tar.gz liberty-38504ded1d9f1a23dfd8c454e7558e2a8e611e33.tar.bz2 liberty-38504ded1d9f1a23dfd8c454e7558e2a8e611e33.zip | |
new method to check if a service is required - requires lcconfig and is compatible with non-lcconfig installs defaulting to true
| -rw-r--r-- | LibertyContent.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/LibertyContent.php b/LibertyContent.php index 8ebc7ee..23d2e8a 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ /* Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.421 2010/02/15 15:57:07 wjames5 Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.422 2010/03/06 23:47:39 wjames5 Exp $ * @author spider <spider@steelsun.com> */ @@ -844,7 +844,7 @@ class LibertyContent extends LibertyBase { $ret = TRUE; // we return true by default to preserve legacy service opperation which has no content type preferences if( $gBitSystem->isPackageActive( 'lcconfig' ) ){ - // LCConfig is a singlton class + // LCConfig is a singleton class $LCConfig = LCConfig::getInstance(); // LCConfig negates services by content type // if result is not 'n' then service should apply to this content type @@ -858,6 +858,25 @@ class LibertyContent extends LibertyBase { /** + * check if a service is required for this content type + * requires package LCConfig + * provisional method until LCConfig package is integrated into the core + */ + function isServiceRequired( $pServiceGuid ){ + global $gBitSystem; + $ret = TRUE; // we return true by default to preserve legacy service opperation which has no content type preferences + + if( $gBitSystem->isPackageActive( 'lcconfig' ) ){ + // LCConfig is a singleton class + $LCConfig = LCConfig::getInstance(); + return ( $LCConfig->getConfig( 'service_'.$pServiceGuid, $this->mContentTypeGuid ) == 'required' ); + } + + return $ret; + } + + + /** * Default liberty sql for joining a content object table to liberty. * We are proposing a new way of building queries here where we build up everything in a hash with implicit AND over all * where clauses and then do an array_merge and concatenation in a single function at the end. See convertQueryHash for details. |
