Created
February 7, 2012 14:23
-
-
Save ironsmile/1759915 to your computer and use it in GitHub Desktop.
distrustful function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// freakishly distrustful about its arguments function | |
function document_mark_as_sent($invoices){ | |
global $page, $db; | |
if(empty($invoices)){ return; } | |
if(!is_array($invoices)){ $invoices = array((int)$invoices); } | |
if(!is_object($page) or !is_object($db)){ return; } | |
if(!isset($page->firm) or !$page->firm){ return; } | |
if( is_object($invoices[0]) ){ // значи е масив от Invoice обекти | |
$invoices = array_map(create_function('$i', 'return $i->id;'), $invoices); | |
} | |
... тяло на фунцкията ... | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment